On Thu, 13 Oct 2011 20:40:50 +0200, Howard Lewis Ship <[email protected]>
wrote:
One thing I'm considering is changing the cache inside the PageSource
service to use WeakReferences, rather than SoftReferences, for pages.
I may make that optional, perhaps with a symbol
"tapestry.large-application-optimizations" that could be enabled to
choose which mode to run things in. Most of this will need to slip
into Tapestry 5.4.
What I'm seeing is that after (attempting to) load all pages, the app
is quite memory starved (over 1 gb of memory usage) but the JVM
doesn't seem to be evicting my soft references. I'm looking for
places those references can leak. but not finding any.
That might not be a leak, unused SoftReferences are by default kept alive
for 1 second per available MB of heap space:
http://www.oracle.com/technetwork/java/hotspotfaq-138619.html#gc_softrefs
If you set -XX:SoftRefLRUPolicyMSPerMB to a low value they should be
evicted much faster.
also, the server VM will attempt to expand the heap in order to avoid
clearing SoftReferences:
http://stackoverflow.com/questions/299659/what-is-the-difference-between-a-soft-reference-and-a-weak-reference-in-java/299702#299702
the policy for the "-client" and "-server" JRE's are different:
the -client JRE tries to keep your footprint small by preferring
to clear SoftReferences rather than expand the heap, whereas
the -server JRE tries to keep your performance high by preferring
to expand the heap (if possible) rather than clear SoftReferences.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]