3

I'm currently having this problem where I am executing a query that will load large of records. At first execution, it is successful, but when I execute again, I am having java heap size out of memory.

I Know I can increase java heap size using command line, but that requires a compiled jar file. But I am currently on the development process, so how can I increase java heap size in that case?

Im using Elipse as my IDE.

Thanks for any response.

3
  • See this question: stackoverflow.com/questions/880855/…. Is that what you are looking for? Commented Mar 10, 2012 at 8:14
  • Be careful. It may be that you're not using Hibernate properly and it certainly sounds like the application you're building could end up with memory issues. Commented Mar 10, 2012 at 17:08
  • @ james DW, although it worked by adding a vm argument -Xmx1024m, I am still considering your suggestion, I think there is also problem on how I used hibernate that's why I'm having this error! Commented Mar 11, 2012 at 23:45

3 Answers 3

3

It doesn't require a compiled jar file. Choose Run - Run configurations... - Select your run configuration - Arguments tab. Then enter the appropriate command line argument in the VM arguments text box: -Xmx1024m for example.

Sign up to request clarification or add additional context in comments.

1 Comment

Recto, if this was the correct answer you should mark it as such.
0

You can modify the eclipse.ini file located inside of our eclipse directory .
There you will find Xms40m Xmx256m parameter with some value , you can increase it to Xms256m Xmx1024m . Then check whether outofmemory error is still there . If its there then try tuning these parameter slightly increasing and check.

2 Comments

This will modify Eclipse's own memory parameters. It won't change the memory parameters of the programs launched by Eclipse.
Yeah right . Actually all the component using java memory can be handeled by providing these parameters in different places. Like when when starting the server with these parameters
0

Apperently that was not enough for an answer... well, let me just copy the text from those answers instead :S

You can use the environment variable _JAVA_OPTIONS to set the default heap size. This will change the heap size for all Java programs. Like this:

export _JAVA_OPTIONS="-Xmx1g"

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.