Re: Disabling Events

Martin Matula <[email protected]> Thu, 27 Mar 2003 09:43:42 +0100
Newsgroups gmane.comp.java.netbeans.modules.mdr.devel
Message-ID <[email protected]>
Hi Thorsten,
I am not very open to put something in that will allow anybody to turn 
off events for everybody. Would it be unacceptable for you to unregister 
from listening to certain events while loading and then register your 
listeners back after the document is loaded? After I fix a bug in MDR 
(shortly), the MDR will not hold event objects that do not need to be 
distributed anywhere. So this would save you and it is the easiest and 
cleanest solution IMO.
Martin

Thorsten Sturm wrote:
> Hi Martin,
> 
> if you are using a transaction around the loading of data for MDR, the change events get collected until the end of the transaction. Depending on the amount of data to be loaded, the number of events can be huge and therefore fill up the heap.
> 
> To give you some numbers, loading a quite big xmi file will push up the memory consumption of the JVM to about 440M  before I receive an OutOfMemoryError (with -Xmx384 as setting). Not using a transaction around loading would load the same xmi with no problem and a maximum memory consumption of about 190M. The only difference between the two tests I can see is, that in the latter one, change events get consumed right after they are created.
> 
> We need a solution to this as soon as possible (and I'm sure this would be a problem you will encounter yourself when using MDR in the new java editor with big files). Right now, we have found a work-around, but it's a dirty one slowing down loading dramatically.
> 
> What I like to see is either a way to stop the creation of certain event types or some kind of auto-flush, where events got consumed right after creation even within transactions. Of course, this has should be turned on and off on demand and for specific event types only (e.g. I want to supress change events but still need to receive transaction events).
> 
> Thorsten
>