Dear mechanical-sympathisers!I'm hitting some GC limits in my app; popularity has scaled it to the point where there are just too may objects created, creating a linear slowdown with the good-ol' tracing algorithm running over the old gen.However, I think there is an easy way out- my application uses a lot of caching, and up to this point it's all vanilla HashMaps and LinkedHashMaps.So I was thinking of refactoring much of this, using off-heap techniques.
I can probably write my own, adapting excellent articles such as Martin's (http://mechanical-sympathy.blogspot.co.uk/2012/10/compact-off-heap-structurestuples-in.html), but was wondering if there is some framework/library out there, packaging a tested solution in a nice open source form, hopefully leniently licensed. Why re-invent the wheel if there is a more bug-free solution out there?
Ideally this would use Unsafe, or even better, give you an option of using Unsafe vs ByteBuffers vs something else, for compatibility's sake.But to be honest, I don't see myself using any other VM than Oracle, so this is really just a nice to have.
--Peer-reviewed benchmarks, a good simple or java.util.Map API, or variety of algos (linked maps, hash maps, etc) are a definitive bonus!Many thanks!
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
When you say "...there are just too may objects created, creating a linear slowdown with the good-ol' tracing algorithm running over the old gen.", do have numbers to show that?
If your only problem is that the tracing algorithm for the Oldgen marker is taking more CPU, the simplest solution for that is to increase the Olgen size without growing the amount of heap you actually use. E.g. for each doubling of the oldgen size, the efficiency of the tracng algorithm will double.
A thrashing oldgen marker is most often a symptom of trying to use too much of a small heap, and growing your heap size is the easiest way to avoid that thrashing..
On the other hand, if your problem is not slowdown due to oldgen taking too much CPU, but pauses (which tend to grow lnearly with heap size or live set size on pausing oldgen collectors) then taking things off the heap or using a collector they doesn't pause no matter what the heap size is are your two main options.

Not that efficient and off-heap HashMaos alternatives are wrong, but I'd double check your problem first:
When you say "...there are just too may objects created, creating a linear slowdown with the good-ol' tracing algorithm running over the old gen.", do have numbers to show that?
If your only problem is that the tracing algorithm for the Olgen marker is taking more CPU, the simplest solution for that is to increase the Olgen size without growing the amount of heap you actually use. E.g. for each doubling of the oldgen size, the efficiency of the tracng algorithm will double.
A thrashing oldgen marker us most often symptom of trying to use too much of a small heap, and gleowing re heap surge easiest way to avoid that thrashing..
On the other hand, if your problem is not slowdown due to oldgen taking too much CPU, but pauses (which tend to grow on early with heap size or live set size on pausing oldgen c, then taking things off the heap or using a collector they doesn't pause no matter what the heap size is are your two main options.
You'd probably want to reduce the initiating occupancy threshold if you doubled the old gen. But yes, the idea is that your (larger) old gen would provide a bigger buffer for holding promoted (but not eternal) objects, and the lower initiating threshold may help the concurrent GC threads keep up with your promotion rate. This assumes you're not hitting full gc due to fragmentation.
sent from my phone
Peter Lawrey's ChronicleMap.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
It will increase your application's throughput, not GC. The assumption is that tracing work is proportional only to the live set size, and not total size of a generation. If you double old gen but keep promotion rate and live set size the same, we know (based on earlier sentence) that GC, when it kicks in, will not have to spend more time than before (because live set size is the same). By doubling the old gen then, you allow for more (ultimately dead) objects to be promoted before GC kicks in; in fact, you double the number of them allowed. This means GC runs half as frequently, yet each run of it spends the same amount of time as before (again, because live set size is the same).
sent from my phone
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.