2

I have some difficulties to find documents about DB4O. How can I control cache of the DB4O? I think than its connection is expending all memory of our server. I want set the minimal cache configuration. Could anyone recommend me some document or send me some examples?

I'm glad for anyone who can help.

2 Answers2

1

If you already made the cache configuration like @Gamlor said, the problem can be a object corrupted, you can delete this object and defrag your database to improve performance

Zero
  • 533
  • 3
  • 13
0

I would recommend looking at it with a profiler. Then you can see what kind of classes take up space.

A typical pitfall with db4o is that that a 'ObjectContainer' is kept open for a long time, with a high activation depth. Then a large part of your object graph is kept in memory.

Some nobs to try:

configuration.common().weakReferenceCollectionInterval(milli-secs);

How often db4o clears up it's weak reference cache system. If you lower that interval, cleans up more aggressive.

There is a file level cache. I think it's quite low by default. Anyway, here's setting:

Storage fileStorage = new FileStorage();
// A cache with 128 pages of 1024KB size, gives a 128KB cache
Storage cachingStorage = new CachingStorage(fileStorage,128,1024);
configuration.file().storage(cachingStorage);

Maybe there are more caches. I don't remember all of then.

Gamlor
  • 12,978
  • 7
  • 43
  • 70