• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
AW: Out of memory
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AW: Out of memory


  • Subject: AW: Out of memory
  • From: "Muckenhirn, Ralf" <email@hidden>
  • Date: Thu, 28 Jun 2007 12:21:15 +0200
  • Thread-topic: Out of memory

Thanks for your help. It seems to help.

 

Ralf

 

 

Von: webobjects-dev-bounces+ralf.muckenhirn=email@hidden [mailto:webobjects-dev-bounces+ralf.muckenhirn=email@hidden] 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      (email@hidden)

Help/Unsubscribe/Update your Subscription:

 

This email sent to email@hidden

 

 _______________________________________________

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

Webobjects-dev mailing list      (email@hidden)

Help/Unsubscribe/Update your Subscription:

 

This email sent to email@hidden

 

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Out of memory (From: "Muckenhirn, Ralf" <email@hidden>)
 >Re: Out of memory (From: Ulrich Köster <email@hidden>)
 >Re: Out of memory (From: Ken Anderson <email@hidden>)

  • Prev by Date: Re: Out of memory
  • Next by Date: Problem with a form
  • Previous by thread: Re: Out of memory
  • Next by thread: Re: Out of memory
  • Index(es):
    • Date
    • Thread