-
May 19th, 2011, 12:21 PM
#1
Maximum Heap Size?
I have an application which processes large XML files that is very memory-intensive. In order to get the app to run, I've been tweaking the -Xmx and -Xms options that I pass to javaw.exe. I've found that any value greater than -Xmx1500M causes the JVM launcher to spit an error at me reading "Could not create the Java virtual machine". Is there a way I can continue to increase the maximum heap size? Is there some sort of hard-coded limit that I'm hitting?
The machine I'm using for this is running Windows 7 64-bit and has 24GB of RAM, so I'm confused as to why I can't allocate more memory to the heap.
Thanks in advance!
-
May 20th, 2011, 08:20 AM
#2
Re: Maximum Heap Size?
I think you need to look at how you are processing the XML instead of how to increase the heap size. There are several different ways to process XML in Java, one of which is buffered so that you can process large files.
Can you post a small portion of your code and show how you are parsing it so that we may help?
-
May 23rd, 2011, 04:27 AM
#3
Re: Maximum Heap Size?
Sequential processing using SAX is generally the preferred method for processing large XML files, as DOM tries to load the whole file for random access - however, the choice does also depend on the processing requirements.
Premature optimization is the root of all evil in programming...
C.A.R. Hoare
Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.
-
May 28th, 2011, 11:50 AM
#4
Re: Maximum Heap Size?
Right, there could be ways I can make the xml processing more efficient. However, I do not have access to the code base. This is a standalone static analysis tool provided by a third-party, so I cannot modify the code.
-
May 28th, 2011, 01:40 PM
#5
Re: Maximum Heap Size?
Have you tried setting true binary block sizes, like -Xmx2048M or -Xmx2G ?
I haven't tried such large heap allocations, but I have sometimes found the JVM sensitive to the block size...
Alternatively, it might be worth checking whether the OS has default settings to limit process memory allocation - it might be that it needs adjusting.
Less is more...
M. van der Rohe
Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.
-
May 28th, 2011, 03:42 PM
#6
Re: Maximum Heap Size?
No, I haven't tried true binary block sizes. I suppose that's worth a shot. I doubt that the OS is limiting the process's memory allocation, since I'm able to run other applications (non java based) that use up to 15GB of RAM.
I would expect that most people haven't had much experience with such large heap sizes
Thanks for the advice!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|