Thanks for your help. It seems to help. 

 

Ralf

 

 

Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Ken Anderson
Gesendet: Donnerstag, 28. Juni 2007 12:14
An: Ulrich Köster
Cc: webobjects-dev Development
Betreff: Re: Out of memory

 

In case you're not understanding what Uli is telling you here, he's 
recommending that you use a new editing context instead of your session editing 
context for each invocation.  Although your myLog instance will eventually be 
garbage collected, other resources that EOF creates will live as long as the 
editing context does.  It's very inexpensive to create new contexts, so unless 
you need objects to stick around for a while, it's a really good idea to use 
editing contexts that will get garbage collected as well.

 

Ken

 

On Jun 28, 2007, at 5:52 AM, Ulrich Köster wrote:





public class MyService implements IMyService {

 

      public void storeToDB(String text1, String text2, String text3, String 
text4, String text5) {

            EOEditingContext ec = new EOEditingContext();

//or

// EOObjectStoreCoordinator parent = new EOObjectStoreCoordinator();

// EOEditingContext ec = new EOEditingContext(parent);

            MyLog myLog = new MyLog();

            myLog.setCol1(text1);

            myLog.setCol2(text2);

            myLog.setCol3(text3);

            myLog.setCol4(text4);

            myLog.setCol5(text5);

            ec.insertObject(myLog);

            ec.saveChanges();

      }

}

uli

 

Am 28.06.2007 um 10:54 schrieb Muckenhirn, Ralf:





 Hello,

 

I know there were some big discussions about that problem before. But I have 
not found any solution for my problem until now.

I've created a small and very simple web-service using WebObjects to reproduce 
my problem (see below). I then calling this web-service from a small 
application by invoking with axis every 200ms.

When looking to the used memory of my web-service it will grow continuously 
over the time. After a while (maybe 30 min to 1h) I get a 
java.lang.OutOfMemory: Heap overflow error.

I've tried a lot of things like revert, invalidateAllObjects, dispose (where I 
get a java.lang.IllegalStateException).

Also increasing the max heap size for the JVM does not help. The error appears 
only later.

I've used JProfiler to profile the web-service and found the most (also 
increasing) memory usage in editingContext()._initWithParentObjectStore().

 

I've tried this example on a WindowsXP with WebObjects 5.2.4 as well on a Apple 
XServe with WebObjects 5.3. 

 

public class MyService implements IMyService {

 

      public void storeToDB(String text1, String text2, String text3, String 
text4, String text5) {

            WOSession session = 
WOWebServiceUtilities.currentWOContext().session();

            EOEditingContext ec = session.defaultEditingContext();

            //ec.setUndoManager(null);

            ec.undoManager().disableUndoRegistration();

 

            MyLog myLog = new MyLog();

            myLog.setCol1(text1);

            myLog.setCol2(text2);

            myLog.setCol3(text3);

            myLog.setCol4(text4);

            myLog.setCol5(text5);

            ec.insertObject(myLog);

            ec.saveChanges();

      }

}

 

Any ideas?

 

Ralf

 

 _______________________________________________

Do not post admin requests to the list. They will be ignored.

Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)

Help/Unsubscribe/Update your Subscription:

http://lists.apple.com/mailman/options/webobjects-dev/ulrich.koester%40assense.com

 

This email sent to [EMAIL PROTECTED]

 

 _______________________________________________

Do not post admin requests to the list. They will be ignored.

Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)

Help/Unsubscribe/Update your Subscription:

http://lists.apple.com/mailman/options/webobjects-dev/kenlists%40anderhome.com

 

This email sent to [EMAIL PROTECTED]

 

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to