• 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
Avoiding java.lang.OutOfMemoryError: Java heap space
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Avoiding java.lang.OutOfMemoryError: Java heap space


  • Subject: Avoiding java.lang.OutOfMemoryError: Java heap space
  • From: Gennady Kushnir <email@hidden>
  • Date: Tue, 22 Jun 2010 23:25:37 +0400

Hello List!

I have a task to form an archive of a good bunch of WO-generated HTML
pages to HDD.
To achieve this I create a background thread to perform the task.

In this thread I create a dummy WOContext :

		WOApplication app = WOApplication.application();
		String dummyUrl = app.cgiAdaptorURL() + "/" + app.name() + ".woa/wa/dummy";
		if(ses != null) {
			dummyUrl = dummyUrl + "?wosid=" + ses.sessionID();
		}
		WORequest request = app.createRequest( "GET", dummyUrl, "HTTP/1.0",
null, null, null);
		WOContext dummyContext = new WOContext(request) {
			public boolean shouldNotStorePageInBacktrackCache() {
				return true;
			}
		}

After that in a loop I prepare my pages (in fact there are several
WOComponent's in work):

		 WOComponent page =
WOApplication.application().pageWithName("MyPageName", dummyContext);

and write them to HDD:

 		NSData content = page.generateResponse().content();
 		content.writeToStream(fileOutputStream);


The problem is that when the loop is long and the page contents is
complex my JVM runs out of memory.
What am I doing wrong? It seems like WO is storing something
unnecessary, how should I tell it to forget that?
At least how can I diagnose what exactly the memory is filled with?

Gennady
 _______________________________________________
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

  • Follow-Ups:
    • Re: Avoiding java.lang.OutOfMemoryError: Java heap space
      • From: Farrukh Ijaz <email@hidden>
  • Prev by Date: Re: wotaskd/Monitor eating lot of RAM on Linux?
  • Next by Date: Re: Avoiding java.lang.OutOfMemoryError: Java heap space
  • Previous by thread: Re: wotaskd/Monitor eating lot of RAM on Linux?
  • Next by thread: Re: Avoiding java.lang.OutOfMemoryError: Java heap space
  • Index(es):
    • Date
    • Thread