Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jdt-core-dev] How big should we make the JDT cache?

The new JDT index uses a cache of (configurable) fixed size. The optimal size of the cache is the smallest we can make it before performance starts to degrade in a large highly fragmented database. This can only be determined experimentally by measuring the performance of the database on various benchmarks with different cache sizes. This hasn't been done yet (and probably shouldn't until the db format is stable).


So the question is: How much memory can we allocate to the cache right now as a temporary measure until we have better data?


When I first submitted the index, I used a cache size of 5 MB. We had a number of bug reports about freezes due to poor cache utilization so I changed the cache size to match the size of the CDT cache (256MB or 10% total heap space, whatever is smaller).

Andrey was concerned about the memory usage and filed this bug:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=511693

...but I realized that this shouldn't be my decision to make since we all need to share the RAM. :-)

My inclination is to keep it as-is -- leave the JDT cache at exactly the same size as the CDT cache. That way, if there are any differences in performance between JDT and CDT we can rule out differences in the cache size as the cause. Once the rest of the DB format is fully stablized, we can use some benchmarks to take measurements and work out what the real optimal cache size is. I suspect it will be a lot lower than 256MB.

However, if the JDT core community (and my project leads in particular) feel differently, I'm happy to live with that decision.

  - Stefan

Back to the top