Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > OutOf Memory exception under Eclipse when using relatively small amount of heap

Reply
Thread Tools

OutOf Memory exception under Eclipse when using relatively small amount of heap

 
 
lennyw@comcast.net
Guest
Posts: n/a
 
      05-24-2006
Hi

I've tried an experimental app under Eclipse, that parses / transforms
a large (96Mb) xml file using the java XSLT library DOM parser and
then tried the SAX parser. The program runs fine with smaller XML
input files but exits with OutOfMemory with the large input file.

It seemed odd to me that I would get an out of memory because I'm set
up with quite a bit of physical memory.
My setup is:

WinXP Pro
768 Mb Ram
Eclipse -vmargs -Xmx1628M (biggest I can set it for, and still have it
load)
jvm 1.4.2_11
WinXP Virtual memory setup: Min 1149Mb Max 4095 (also tried "Let system
manage virtual memory")

It's a not heavily loaded desktop computer running little more than the
OS, an antivirus program and Eclipse.

To get a better idea of what's going on, I tried making a simple heap
test program
(below),which allocates in units of 1,0000,000 bytes until it crashes.
It consistently crashes with the array index i = 32. I find the value
32
to be a little suspicious, but looking through the various properties
of the test programs "project" parameters in Eclipse, I don't find any
limitations.

Can you give me some specific things to try or a general strategy I can
use
to isolate the cause of this problem?

Thanks in advance for any help.

Lenny Wintfeld

ps - here's the test program

public class TestHeapOverflow {

public static void main(String[] args) {
char [] [] arrayArray = new char[2000][];
int i = 0;
try {
for (i = 0; i<2000; i++)
{
arrayArray[i] = new char[1000000];
}
} catch (RuntimeException e) {
e.printStackTrace();
}
finally{System.out.println("i="+i);}
}

}

 
Reply With Quote
 
 
 
 
Oliver Wong
Guest
Posts: n/a
 
      05-24-2006

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> Hi
>
> I've tried an experimental app under Eclipse, that parses / transforms
> a large (96Mb) xml file using the java XSLT library DOM parser and
> then tried the SAX parser. The program runs fine with smaller XML
> input files but exits with OutOfMemory with the large input file.
>
> It seemed odd to me that I would get an out of memory because I'm set
> up with quite a bit of physical memory.
> My setup is:
>
> WinXP Pro
> 768 Mb Ram
> Eclipse -vmargs -Xmx1628M (biggest I can set it for, and still have it
> load)


This "experimental app"; is it a plugin to Eclipse? If not, then you've
given Eclipse 1628MB of RAM, but not the app. The app runs in a seperate VM,
and is allocated memory seperately. In the run-configuration for the app,
add -Xmx128M or something like that to the "VM Arguments" section.

- Oliver

 
Reply With Quote
 
 
 
 
lennyw@comcast.net
Guest
Posts: n/a
 
      05-24-2006
Wow thanks! I thought the Xmx in the -vmargs was for the vm that runs
the app. Your suggestion worked out great.

Lenny Wintfeld

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[C/Linux] How to get amount of allocated memory from within a process (heap size) Gennady Bystritsky Ruby 4 07-27-2009 06:56 PM
what's so wrong with my code?? Just trying to save a single node outof a SOAP Envelope monsalvo@gmail.com XML 2 08-12-2008 05:38 PM
What is a "boot loop" and how do I tell my friend how to get outof it? Grandpa Chuck Computer Support 10 03-24-2007 04:51 PM
How to position a custom webcontrol relatively under vs.net 2005? amanda.shen@grapecity.com ASP .Net Building Controls 1 01-05-2006 09:14 AM
Amount of heap memory reserved by a procces jose luis fernandez diaz C++ 2 02-09-2004 10:10 AM



Advertisments