Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Exception in thread "Java indexing" java.lang.OutOfMemoryError: Java heap space
Exception in thread "Java indexing" java.lang.OutOfMemoryError: Java heap space [message #310138] Wed, 22 November 2006 15:41 Go to next message
Eclipse UserFriend
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 #310146 is a reply to message #310138] Wed, 22 November 2006 20:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wharley.bea.com

"Michael Giroux" <michael.giroux@bull.com> wrote in message
news:ek2cla$mfo$1@utils.eclipse.org...
>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.


What if you add something like -Xmx512m to the VM args in the launch dialog?
That is, just give it more memory?
Re: Exception in thread "Java indexing" java.lang.OutOfMemoryError: Java heap space [message #310232 is a reply to message #310146] Mon, 27 November 2006 13:08 Go to previous messageGo to next message
Eclipse UserFriend
Thanks,

> What if you add something like -Xmx512m to the VM args in the launch
> dialog? That is, just give it more memory?

I had -Xmx384m. I'll try going higher.

Michael
Re: Exception in thread "Java indexing" java.lang.OutOfMemoryError: Java heap space [message #310354 is a reply to message #310146] Wed, 29 November 2006 08:56 Go to previous messageGo to next message
Eclipse UserFriend
"Walter Harley" <wharley@bea.com> wrote in message
news:ek2srs$ot1$1@utils.eclipse.org...
> What if you add something like -Xmx512m to the VM args in the launch
> dialog? That is, just give it more memory?

Well, this was a good suggestion, but it does not work consistently.

I have tried to add Thread.sleep(5000) to my test code to delay the
AntRunner for a while but this too is inconsistent.

The error is always the same, OOM in java indexing which leads me to suspect
that the problem is caused by my calling AntRunner.run too soon.

I never get the error if I run the test manually from the UI, so it is very
much related to being kicked off in a junit environment, so the question
remains --- how to detect that java index is running and how to pause it or
wait for it to finish?

I am not able to find anything in help about java indexing, or how one might
disable it.

Michael
Re: Exception in thread "Java indexing" java.lang.OutOfMemoryError: Java heap space [message #310414 is a reply to message #310138] Fri, 01 December 2006 09:50 Go to previous messageGo to next message
Eclipse UserFriend
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.

Michael
Re: Exception in thread "Java indexing" java.lang.OutOfMemoryError: Java heap space [message #310417 is a reply to message #310414] Fri, 01 December 2006 12:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse5.rizzoweb.com

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 #310455 is a reply to message #310417] Mon, 04 December 2006 11:37 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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
Previous Topic:Callisto update site question.
Next Topic:junitreport generates incorrect output when run w/ AntRunner
Goto Forum:
  


Current Time: Thu Jul 24 06:16:25 EDT 2025

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

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

Back to the top