Exception in thread "Java indexing" java.lang.OutOfMemoryError: Java heap space [message #310138] |
Wed, 22 November 2006 15:41  |
Eclipse User |
|
|
|
I seem to be getting this quite often when I run JUnit tests. Situation is
as follows:
1. From the main workbench I luanch a JUnit Plug-in Test
2. the JUnit Plug-in Test launch generates an application project containing
JUnit test cases for my application.
3. the JUnit Plug-in Test launch invokes the newly generated JUnit code
using AntRunner.
The OOM error occurs while the AntRunner is executing the test code.
The error always occurs in Java indexing, so my first thought is to disable
the indexing. Is that possible? If not, does anyone have a suggestion to
avoid this.
Thanks
Michael Giroux
|
|
|
|
|
|
|
|
Re: Exception in thread "Java indexing" java.lang.OutOfMemoryError: Java heap space [message #310455 is a reply to message #310417] |
Mon, 04 December 2006 11:37   |
Eclipse User |
|
|
|
Buttons on the UI require the user to take action for every launch. More
importantly, in this
specific case, increased memory is required for *all* forms of execution
that might result in
the java indexer running. There are lots of reports of OOM errors in the
newsgroups,
and various blogs. I do not think it is very friendly to require every user
to check buttons,
and every programmer to add these values to code that initiates launches.
It is well known that the memory requirements for Eclipse 3.2 are greater
than the
default memory settings provided by the Sun JVM. I think it is in the best
interest of
the Eclipse project to recognize this fact and take some action to guarantee
that
every form of launch has enough memory, whatever enough is. Perhaps that is
some
value less than the amounts specified for the main launch, but it is
certainly something
more than the JVM is providing by default.
Michael
"Eric Rizzo" <eclipse5@rizzoweb.com> wrote in message
news:ekpp7m$dm0$1@utils.eclipse.org...
> Michael Giroux wrote:
>> The problem has been resolved for now. The cause of the problem is that
>> the launch was using default VM args for memory. It did not occur to me
>> that the launch would not use vmargs specified in the eclipse.ini file,
>> so I did not specify any on the launch.
>>
>> After adding -Xmx and -XX:MaxPermSize parameters to the launch, the test
>> is now running without problem.
>>
>> I asked that the bug be transferred to the launch team to consider
>> inheriting memory args from the launching workspace.
>
> I don't know the bug number, so I can't check if someone has already
> responded to that request. But doing as you suggest is probably not
> desirable because the memory settings required to run Eclipse are likely
> to be very different than those required for an application or test suite
> that you develop. Perhaps a convenience button that would populate the
> launch params with those for the Eclipse JVM; but blindly inheriting them
> for all launches is not appropriate IMO.
>
> Eric
|
|
|
Re: Exception in thread "Java indexing" java.lang.OutOfMemoryError: Java heap space [message #310457 is a reply to message #310455] |
Mon, 04 December 2006 12:16   |
Eclipse User |
|
|
|
Originally posted by: eclipse5.rizzoweb.com
Michael Giroux wrote:
> Buttons on the UI require the user to take action for every launch. More
> importantly, in this
> specific case, increased memory is required for *all* forms of execution
> that might result in
> the java indexer running. There are lots of reports of OOM errors in the
> newsgroups,
> and various blogs. I do not think it is very friendly to require every user
> to check buttons,
> and every programmer to add these values to code that initiates launches.
>
> It is well known that the memory requirements for Eclipse 3.2 are greater
> than the
> default memory settings provided by the Sun JVM. I think it is in the best
> interest of
> the Eclipse project to recognize this fact and take some action to guarantee
> that
> every form of launch has enough memory, whatever enough is. Perhaps that is
> some
> value less than the amounts specified for the main launch, but it is
> certainly something
> more than the JVM is providing by default.
There is no way for Eclipse to know how much memory a Launch is going to
need. In fact, I don't have any JUnit test suites that require tweaking
the JVM memory settings. I state that just to refute the idea that every
Launch needs more memory.
I'm not even sure it is accurate to say that extra memory is
unconditionally required when the Java indexer will run. But even if
that could be proven or stated authoritatively, does Eclipse know for
which Launches that will happen? I don't see how it is related to a
Launch, because I don't know the internals of how the indexer works.
I'll repeat: Eclipse's memory requirements are completely different than
most application and test suite memory requirements.
Now, you aren't talking about PDE launches, are you? If so, I might be
more inclined to at least partially agree about upping the dafault
memory settings for launches...
Eric
|
|
|
Re: Exception in thread "Java indexing" java.lang.OutOfMemoryError: Java heap space [message #310458 is a reply to message #310457] |
Mon, 04 December 2006 12:25  |
Eclipse User |
|
|
|
Eric,
Thanks for your persistence.
"Eric Rizzo" <eclipse5@rizzoweb.com> wrote in message
news:el1l2t$im9$1@utils.eclipse.org...
> Now, you aren't talking about PDE launches, are you? If so, I might be
> more inclined to at least partially agree about upping the dafault memory
> settings for launches...
>
> Eric
I agree that some of my tests do not fail, and I have never seen a failure
with a simple JUnit Test. In my specific case, I'm talking about a JUnit
Plug-in Test Launch. The test cases generate code into a project, compile
the code then attempt to execute the generated code, so yes, this is not a
typical launch.
However, since every failure has been OOM in the java indexer, it seems to
me that a solution probably needs to take that fact into account.
Michael
|
|
|
Powered by
FUDForum. Page generated in 0.04204 seconds