[
https://issues.apache.org/jira/browse/CAY-1776?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13511599#comment-13511599
]
Andrus Adamchik commented on CAY-1776:
--------------------------------------
While I can't yet say what is causing OutOfMemory, here is one note:
POST_PERSIST and other lifecycle events are not dispatched via EventManager.
EventManager is used for internal cross-context synchronization, so that's an
entirely different beast. I.e. your custom listener is probably unrelated to
InvocationDispatch accumulation.
BTW, do you have some statistics on the number of InvocationDispatch instances
when your app is approaching its memory limits? (you can gather that via jmap
http://docs.oracle.com/javase/6/docs/technotes/tools/share/jmap.html or some
Java profiling tool). Could be that it is not that there are many
InvocationDispatches, but rather that a few InvocationDispatches originating
from the man thread contain a huge data snapshots and take a long time to
process.
And yeah, #1 looks the most promising in this situation.
> OutOfMemory during lifecycle events
> -----------------------------------
>
> Key: CAY-1776
> URL: https://issues.apache.org/jira/browse/CAY-1776
> Project: Cayenne
> Issue Type: Improvement
> Components: Lifecycle Extensions
> Affects Versions: 3.0.2, 3.1B1
> Environment: Linux x64, Mac OS X Lion
> Reporter: Nils Verheyen
> Priority: Minor
>
> Inside EventManager.java in Cayenne 3.0.2 and DefaultEventManager in Cayenne
> 3.1 there is the inner class Dispatch with the following code:
> synchronized (eventQueue) {
> eventQueue.add(new InvocationDispatch(
> eventArgument,
> subject,
> invocation));
> eventQueue.notifyAll();
> }
> Inside my code a event listener is added once, but inside the eventQueue
> multiple InvocationDispatch objects are created and never thrown away. When
> persisting thousands of objects the eventQueue is filled up leading to
> OutOfMemory exceptions.
> Regards,
> Nils
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira