From: Robert Klemme Date: 2007-04-24T03:50:05+09:00 Subject: Re: Tracking down a garbage collection problem On 23.04.2007 19:10, Wincent Colaiuta wrote: > On 23 abr, 15:24, Robert Klemme wrote: >> Careful! As Guy pointed out your code basically locks cache in memory >> itself. > > Whoops, just copied it out of the Pickaxe (p 557) without thinking. > Very silly on my part, as it was only this morning that I had read a > thread about lambda vs GC. > > I've now corrected it and am seeing the following... basically, given > a bunch of calls to the parse method, the finalizer ends up getting > called only some of the time... as you can see, the behavior is > intermittent, so could be tricky to figure out what's going on.... > will continue researching... Maybe you leak only under certain conditions. Dunno how complex your code in parse is but this seems to be an option. Maybe you can print more along with the cache's id so as to get an idea in which cases you don't see finalization. robert