Search the Community

Showing results for tags 'StackOverflowError'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • McObject Embedded Databases
    • Perst
  • Root2

Blogs

  • Steven Graves' Blog

Calendars

  • Community Calendar

Found 2 results

  1. Hi, I'm getting an StackOverflowError at the commit phase when I'm trying to load my database in one transaction. The database is of reasonable size - it contains ~ 350 000 objects, the file size is ~ 70M. The database contents are several interconnected trees. The stack trace looks like java.lang.StackOverflowError at org.garret.perst.impl.StorageImpl.getOid(StorageImpl.java:5397) at org.garret.perst.impl.StorageImpl.storeObject0(StorageImpl.java:3422) at org.garret.perst.impl.StorageImpl.swizzle(StorageImpl.java:3507) at org.garret.perst.impl.StorageImpl.swizzle(StorageImpl.java:4563) at org.garret.perst.impl.StorageImpl.packObject(StorageImpl.java:4860) at org.garret.perst.impl.StorageImpl.packObject(StorageImpl.java:4551) at org.garret.perst.impl.StorageImpl.storeObject0(StorageImpl.java:3434) at org.garret.perst.impl.StorageImpl.swizzle(StorageImpl.java:3507) at org.garret.perst.impl.StorageImpl.swizzle(StorageImpl.java:4563) ... If I increase the thread stack size from default 4M to 8M with the Java -Xss option, the problem disappears. But it is not a good solution since it increases stack size for all threads, which is a waste of memory. Is there a way to limit the recursion depth in Perst? Or control the traversal order? Regards, Vladimir
  2. Hello, I am attempting to persist a list of objects, but whenever the list is above roughly 1000 elements (before the commit), the application runs into a StackOverflowError. I am using Java 1.6.0_26 and Perst 4.30. I have the following code to prevent the StackOverflowError, but I would like to know if there are better ways to handle this sort of errors in my application: public void persistPersentil(PerstDBEnv perstDB, List<PerstPersentilerDTO> persentilerList) { Storage storage = perstDB.getStorage(); PerstStorageRoot storageRoot = (PerstStorageRoot) perstDB.getStorage().getRoot(); int index = 0; for (PerstPersentilerDTO persentil : persentilerList) { index++; storageRoot.getPersentilerIndex().add(persentil); persentil.modify(); storage.store(persentil); if (index % 1000 == 0) { storage.commit(); } } storage.commit(); } Any hints and suggestions would be very welcome!