Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » CacheAdapter prevents garbage collection
CacheAdapter prevents garbage collection [message #476954] Wed, 20 February 2008 02:16 Go to next message
Rafael Chaves is currently offline Rafael ChavesFriend
Messages: 362
Registered: July 2009
Senior Member
Hi all,

In my application, the singleton instance of CacheAdapter keeps holding
onto models even after I unload all resources in a resource set. With
the standard maximum heap size, loading and unloading a model several
times quickly leads to an OutOfMemoryError.

Just for kicks, I imported the org.eclipse.uml2.common plug-in and added
a static flush method to CacheAdapter that just replaces the current
CacheAdapter.INSTANCE with a new, empty one. The problem goes away.
Memory consumption remains constant.

There must be something that my application does that triggers this
problem. I spent some considerably time trying to come up with a simple
test case that would show the problem outside of the scope of my
application, but I haven't managed to do that yet. So instead of opening
a bug report, I decided to ask for help here. So, if CacheAdapter keeps
holding onto model elements, what may I be doing wrong? Any clues?

Thanks,

Rafael
Re: CacheAdapter prevents garbage collection [message #476956 is a reply to message #476954] Wed, 20 February 2008 16:14 Go to previous message
Rafael Chaves is currently offline Rafael ChavesFriend
Messages: 362
Registered: July 2009
Senior Member
Found some interesting info on the following thread, which was started
by myself almost two years ago... :)

http://dev.eclipse.org/newslists/news.eclipse.tools.uml2/msg 04014.html

Turns out I was unknowingly discarding an object that referenced a
resource set without unloading. Explicitly Unloading before
dereferencing fixed the issue.

Cheers,

Rafael


Rafael Chaves wrote:
> Hi all,
>
> In my application, the singleton instance of CacheAdapter keeps holding
> onto models even after I unload all resources in a resource set. With
> the standard maximum heap size, loading and unloading a model several
> times quickly leads to an OutOfMemoryError.
>
> Just for kicks, I imported the org.eclipse.uml2.common plug-in and added
> a static flush method to CacheAdapter that just replaces the current
> CacheAdapter.INSTANCE with a new, empty one. The problem goes away.
> Memory consumption remains constant.
>
> There must be something that my application does that triggers this
> problem. I spent some considerably time trying to come up with a simple
> test case that would show the problem outside of the scope of my
> application, but I haven't managed to do that yet. So instead of opening
> a bug report, I decided to ask for help here. So, if CacheAdapter keeps
> holding onto model elements, what may I be doing wrong? Any clues?
>
> Thanks,
>
> Rafael
Re: CacheAdapter prevents garbage collection [message #626055 is a reply to message #476954] Wed, 20 February 2008 16:14 Go to previous message
Rafael Chaves is currently offline Rafael ChavesFriend
Messages: 362
Registered: July 2009
Senior Member
Found some interesting info on the following thread, which was started
by myself almost two years ago... :)

http://dev.eclipse.org/newslists/news.eclipse.tools.uml2/msg 04014.html

Turns out I was unknowingly discarding an object that referenced a
resource set without unloading. Explicitly Unloading before
dereferencing fixed the issue.

Cheers,

Rafael


Rafael Chaves wrote:
> Hi all,
>
> In my application, the singleton instance of CacheAdapter keeps holding
> onto models even after I unload all resources in a resource set. With
> the standard maximum heap size, loading and unloading a model several
> times quickly leads to an OutOfMemoryError.
>
> Just for kicks, I imported the org.eclipse.uml2.common plug-in and added
> a static flush method to CacheAdapter that just replaces the current
> CacheAdapter.INSTANCE with a new, empty one. The problem goes away.
> Memory consumption remains constant.
>
> There must be something that my application does that triggers this
> problem. I spent some considerably time trying to come up with a simple
> test case that would show the problem outside of the scope of my
> application, but I haven't managed to do that yet. So instead of opening
> a bug report, I decided to ask for help here. So, if CacheAdapter keeps
> holding onto model elements, what may I be doing wrong? Any clues?
>
> Thanks,
>
> Rafael
Previous Topic:Sequence diagram
Next Topic:.uml vs. .xmi
Goto Forum:
  


Current Time: Mon Aug 08 23:20:43 GMT 2022

Powered by FUDForum. Page generated in 0.02197 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top