Home » Newcomers » Newcomers » Eclipse memory allocation problem
Eclipse memory allocation problem [message #626316] |
Wed, 22 September 2010 14:08 |
flpgdt Messages: 4 Registered: September 2010 |
Junior Member |
|
|
Hi,
I'm trying to analyse a ~800mb heap dump, which requires a bigger heap than the standard for my eclipse. however, when I go to the eclipse.ini file and set a ``-Xmx2g`` (or ``-Xmx2048m``) I get an error "Failed to create the Java Virtual Machine".
1) yes, I have enough memory. 2) I can change it up to exactly -Xmx976m. 3) I've tried the standalone MAT analyser and it works with -Xmx1024m, not a byte more. 4) No, 1gb is not enough to analyse that heap, I get a OOM
This is the eclipse error:
This is the MAT error:
(I reckon they are the same, this is just so you can see an example with MAT)
My current eclipse.ini (working) is:
-startup
plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.0.v20100503
-product
org.eclipse.epp.package.java.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx384m
Anybody figures this out?
thanks!
f.
ps.: `-vmargs -Xmx1g` in the command line wont work either.
[Updated on: Wed, 22 September 2010 14:09] Report message to a moderator
|
|
| | |
Re: Eclipse memory allocation problem [message #630089 is a reply to message #626316] |
Thu, 30 September 2010 15:25 |
Eric Rizzo Messages: 3070 Registered: July 2009 |
Senior Member |
|
|
On 9/22/10 10:08 AM, flpgdt wrote:
>
> Hi,
>
> I'm trying to analyse a ~800mb heap dump, which requires a bigger heap
> than the standard for my eclipse. however, when I go to the eclipse.ini
> file and set a ``-Xmx2g`` (or ``-Xmx2048m``) I get an error "Failed to
> create the Java Virtual Machine".
>
> 1) yes, I have enough memory. 2) I can change it up to exactly -Xmx976m.
> 3) I've tried the standalone MAT analyser and it works with -Xmx1024m,
> not a byte more. 4) No, 1gb is not enough to analyse that heap, I get a OOM
>
This is actually not an Eclipse-specific issue; it's a general
Java-on-Windows issue. It's because of how the JVM allocates memory on
Windows; it insists on allocating a contiguous chunk of memory, which
often Windows can't provide, even if there are enough separate chunks to
satisfy the allocation request.
There are utilities that will try to help Windows "defrag" its memory,
which would, in theory, help this situation; but I've not really tried
them in earnest so can't speak to their effectiveness.
One thing that I've heard sometimes that might help is to reboot Windows
and, before starting any other apps, launch the Java app that needs the
big chunk of memory. If you're lucky, Windows won't have fragmented its
memory space yet and Java will get the contiguous block that is asks for.
Somewhere out on the interwebs there are more technical explanations and
analyses of this issue, but I don't have any references handy.
Hope this helps,
Eric
> This is the eclipse error:
>
>
> This is the MAT error:
> http://i.imgur.com/Y1K1c.jpg
>
> (I reckon they are the same, this is just so you can see an example with
> MAT)
>
> My current eclipse.ini (working) is:
>
> -startup
> plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
> --launcher.library
> plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.0.v 20100503
> -product
> org.eclipse.epp.package.java.product
> --launcher.defaultAction
> openFile
> --launcher.XXMaxPermSize
> 256M
> -showsplash
> org.eclipse.platform
> --launcher.XXMaxPermSize
> 256m
> --launcher.defaultAction
> openFile
> -vmargs
> -Dosgi.requiredJavaVersion=1.5
> -Xms40m
> -Xmx384m
>
> Anybody figures this out?
>
> thanks!
>
> f.
>
> ps.: `-vmargs -Xmx1g` in the command line wont work either.
>
|
|
|
Re: Eclipse memory allocation problem [message #630226 is a reply to message #630089] |
Fri, 01 October 2010 08:45 |
jan_bar Messages: 38 Registered: July 2009 |
Member |
|
|
In article <i82a0m$5of$1@news.eclipse.org>, eclipse-bugs@rizzoweb.com
says...
>
> On 9/22/10 10:08 AM, flpgdt wrote:
> >
> > Hi,
> >
> > I'm trying to analyse a ~800mb heap dump, which requires a bigger heap
> > than the standard for my eclipse. however, when I go to the eclipse.ini
> > file and set a ``-Xmx2g`` (or ``-Xmx2048m``) I get an error "Failed to
> > create the Java Virtual Machine".
> >
> > 1) yes, I have enough memory. 2) I can change it up to exactly -Xmx976m.
> > 3) I've tried the standalone MAT analyser and it works with -Xmx1024m,
> > not a byte more. 4) No, 1gb is not enough to analyse that heap, I get a OOM
> >
>
> This is actually not an Eclipse-specific issue; it's a general
> Java-on-Windows issue. It's because of how the JVM allocates memory on
> Windows; it insists on allocating a contiguous chunk of memory, which
> often Windows can't provide, even if there are enough separate chunks to
> satisfy the allocation request.
> There are utilities that will try to help Windows "defrag" its memory,
> which would, in theory, help this situation; but I've not really tried
> them in earnest so can't speak to their effectiveness.
> One thing that I've heard sometimes that might help is to reboot Windows
> and, before starting any other apps, launch the Java app that needs the
> big chunk of memory. If you're lucky, Windows won't have fragmented its
> memory space yet and Java will get the contiguous block that is asks for.
>
> Somewhere out on the interwebs there are more technical explanations and
> analyses of this issue, but I don't have any references handy.
>
> Hope this helps,
> Eric
>
Hi,
just to add more info to what Eric said, under Windows you will not be
able to get more than -Xmx1300, but usually you will get far less. It
depends on OS version and applications/drivers you have installed. You
can use a tool from WindowsInternals called VMMap. It will show you how
the virtual process memory is fragmented and how big is the largest
continuous block.
Jan
|
|
| |
Goto Forum:
Current Time: Fri Apr 19 22:47:06 GMT 2024
Powered by FUDForum. Page generated in 0.08177 seconds
|