Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sapphire » Sapphire 0.7 memory problem!(is it because of @Validation annotation?)
Sapphire 0.7 memory problem! [message #1403192] Tue, 22 July 2014 09:52 Go to next message
Hazem ELRAFFIEE is currently offline Hazem ELRAFFIEEFriend
Messages: 61
Registered: September 2012
Member
Hello all Smile

I've built an editor for an XML file using Sapphire 0.7.2

The XML file is very big and complex, and a sample file of this XML is about 3 MB.

When I first created the editor, it used to work fine, but consumes a lot of memory. When I started to add lots of @Validation annotations to perform some checks, things began to fall apart into the monster "OutOfMemoryError"!!

I got this from Eclipse Memory Analyzer:
17,705 instances of "org.eclipse.sapphire.services.internal.PropertyInstanceServiceContext", loaded by "org.eclipse.sapphire.modeling" occupy 56,569,800 (10.89%) bytes. These instances are referenced from one instance of "java.lang.Object[]", loaded by "<system class loader>"


I don't know if this has something to do with @Validation annotation or not.

What I'm going to do now, is to manually replace every @Validation with a custom Validation Service. I don't know if that's more memory efficient or not.

Any ideas?
Re: Sapphire 0.7 memory problem! [message #1403296 is a reply to message #1403192] Tue, 22 July 2014 17:14 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1023
Registered: July 2009
Senior Member
What's your Xmx setting? Loading large files may require a higher allowance.

PropertyInstanceServiceContext manages all services for a particular service instance. 17.7K instances seems reasonable for 3MB file with lots of property instances. The math works out to 3K per instance, which covers all the services handling the property's semantics.

Switching from @Validation to a custom ValidationService isn't going to help. The framework makes that conversion for you at runtime.

Re: Sapphire 0.7 memory problem! [message #1404181 is a reply to message #1403296] Wed, 30 July 2014 09:29 Go to previous messageGo to next message
Hazem ELRAFFIEE is currently offline Hazem ELRAFFIEEFriend
Messages: 61
Registered: September 2012
Member
-Xmx1024m

and looking at the task manager, it takes all of it!! and still the same problem!
Re: Sapphire 0.7 memory problem! [message #1404654 is a reply to message #1404181] Mon, 04 August 2014 18:15 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1023
Registered: July 2009
Senior Member
That's definitely not ok. Could you do some more profiling to figure out where 1G of memory is going?
Re: Sapphire 0.7 memory problem! [message #1407229 is a reply to message #1404654] Tue, 12 August 2014 06:27 Go to previous messageGo to next message
Hazem ELRAFFIEE is currently offline Hazem ELRAFFIEEFriend
Messages: 61
Registered: September 2012
Member
I used to use 32 bit JRE. Now I switched to 46 bit JRE to allow more than 1 GB memory, and finally the file opened fine taking about 2.3 GB .. It works fine now, but I don't think it's normal for a 3 MB file to open in about 5 minutes in 2.3 GB !

What kind of profiling I can do to help identifying the problem?
Re: Sapphire 0.7 memory problem! [message #1407408 is a reply to message #1407229] Tue, 12 August 2014 14:13 Go to previous message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1023
Registered: July 2009
Senior Member
Quote:
What kind of profiling I can do to help identifying the problem?


Analyze the heap to see where the memory is allocated and for what.
Previous Topic:Required @Type annotation missing
Next Topic:Filtering items int Table/List property editor?
Goto Forum:
  


Current Time: Mon Aug 31 23:49:46 GMT 2015

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

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