|Memory leak in uml2 ? [message #627268]
||Sun, 07 December 2008 20:24
| Alexander Weickmann
Registered: July 2009
I've been programming the last five month on a model merge from the model
of our software to the uml2 format.
A few days ago I first noticed a memory leak in my plugin. I did not see
it earlier because everything went well so far because I had enough
memory. But now I have 300 JUnit tests and at about test 250 my system
gets very slow. So I looked into the system control and my memory was
Then I tried my program itself and started the uml export. Depending on
the size of the model I get 5 to 10 megabyte memory that is allocated and
not beeing freed after the operation.
After killing a full day with trying to get eclipse tptp working (it is
totally bugged) I tried JProbe. I've gone trough the JProbe tutorials and
stuff and after another day now I know how to use that ^ ^
So I did the following:
- Start my plugin in eclipse (Eclipse application run)
- Connect JProbe to the current session
- As the eclipse was loaded with my plugin I started a use case in JProbe
which means from now on data will be collected
- Execute my uml2 export
- Finish the JProbe use case and shutting down everything.
Then JProbe saves me a snapshot which lets me investigate every instance
that has been allocated. I get a list with many hundreds of classes. I
first looked to my own classes, that from my plugin. Everything seems to
be ok there though. There are 0 instances in the memory except the action
which I suppose is left in the memory by eclipse. So I think that's ok.
Then I filtered for all instances org.eclipse.uml2.*
From org.eclipse.uml2.uml.internal.impl.StereotypeImpl there are 2376
instances in the memory and 0 dead. That means not a single one of these
2376 instances has been killed by garbage collection and is still in
memory after the operation. I can also take a look to the referers of
these objects. None of my classes is there, but for example
org.eclipse.emf.common.notify.impl.BasicNotifierImpl$EAdapte rList still
refers to StereotypeImpls
I also have in memory after the operation:
1878 GeneralizationImpl (and 0 killed)
1665 Property (and 6 killed)
1622 ClassImpl (and 528 killed)
1584 ElementImportImpl (and 0 killed)
the list goes on ...
Now I'm really confused what to do? Can the problem be on my side? That I
don't free anything properly? But only my action delegate is in memory
after the operation. But the action is not listed in the referers to the
in memory objects mentioned above and it does not have any member
variables of these ... What can I do now?
Powered by FUDForum
. Page generated in 0.03012 seconds