Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Eclipse memory allocation problem
Eclipse memory allocation problem [message #626316] Wed, 22 September 2010 14:08 Go to next message
flpgdt  is currently offline flpgdt Friend
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:
http://i.imgur.com/NyMLS.jpg

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.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 #626505 is a reply to message #626316] Wed, 22 September 2010 15:44 Go to previous messageGo to next message
Andrew Eisenberg is currently offline Andrew EisenbergFriend
Messages: 382
Registered: July 2009
Senior Member
I think this is a question better asked on the MAT forum:

http://www.eclipse.org/forums/index.php?t=thread&frm_id= 186
Re: Eclipse memory allocation problem [message #626531 is a reply to message #626505] Wed, 22 September 2010 16:03 Go to previous messageGo to next message
flpgdt  is currently offline flpgdt Friend
Messages: 4
Registered: September 2010
Junior Member
MAT isn't even started when I these parameters are read. This is eclipse.

Nonetheless, this should be a more common problem with MAT users. I have the question opened there as well.

rgds.

f.
Re: Eclipse memory allocation problem [message #630089 is a reply to message #626316] Thu, 30 September 2010 15:25 Go to previous messageGo to next message
Eric Rizzo is currently offline Eric RizzoFriend
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 Go to previous messageGo to next message
jan_bar is currently offline jan_barFriend
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
Re: Eclipse memory allocation problem [message #655373 is a reply to message #630089] Sun, 20 February 2011 04:58 Go to previous message
Richard Fiekowsky is currently offline Richard FiekowskyFriend
Messages: 1
Registered: February 2011
Junior Member
This may not be a problem with the VM in which Eclipse runs. Both eclipse.ini and the command-line that starts Eclipse.exe set options for the VM in which Eclipse runs.

When you run a Java program within Eclipse, the Java program runs in its own VM. The memory options for the Java program can be set in the "Run Configuration" for the program. Doing this solved a very similar problem for me.
Previous Topic:Galileo updates don't work
Next Topic:Eclipse doesn't show arguments names in code assist
Goto Forum:
  


Current Time: Fri Apr 19 22:47:06 GMT 2024

Powered by FUDForum. Page generated in 0.08177 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top