[
https://issues.apache.org/jira/browse/COCOON-2151?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12545763
]
Ard Schrijvers commented on COCOON-2151:
----------------------------------------
I commented on COCOON-2146, I'll repeat my text over here:
"Presumably though, if site-usage is fairly uniform, stuff that expires and is
still referenced from AbstractDoubleMapEventRegistry will get regenerated again
at some fairly near point, and replace the old entry with the new one, allowing
it to be freed by the JVM? Only if you're generating lots of unique pages or
short-lived pages and caching them for a long time may it become a 'real'
problem? "
Yes, you would think you absolutely had a point here.....but, unfortunately I
found out, that the MultiHashMap doen *not* act that way !! (note, it has been
a year, and i am not in a position now to dive in the code again but from the
top of my head) :
If you have a MultiHashMap and you put something like
m_keyMMap.put("key1", "value1"); multiple times, your map grows! you'll have 5
times "value1" in it (obviously from a performance POV this is easy to
understand)
So, exactly what you describe above, will result in OOM. Even if you have only
a few possible links, resulting in limited cachekeys, you'll run into OOM in
the end....I am sorry :-)
Anyway, the WeakReference solution is capable of being persisted, but needs
some extra stuff to be done at restart. OTOH, notification from ehcache with
some listeners might be a solution as well, though
1) it has to be independant of ehcache
2) I still think a DoubleMap is really not the way it should be solved. I would
always use WeakReferences for these kind of problems, because the overhead of
keeping the maps in sync is not needed.
> Sub-optimal implementation of AbstractDoubleMapEventRegistry
> ------------------------------------------------------------
>
> Key: COCOON-2151
> URL: https://issues.apache.org/jira/browse/COCOON-2151
> Project: Cocoon
> Issue Type: Improvement
> Components: Blocks: Event Cache
> Affects Versions: 2.1.10, 2.2-dev (Current SVN)
> Reporter: Jörg Heinicke
>
> This is just a follow-up from COCOON-2146 where Ard pointed out some issues
> with AbstractDoubleMapEventRegistry. I just didn't want to lose the
> information when I actually fixed the issue. So I will add it here.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.