This week's book giveaway is in the Reactive Progamming forum.
We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line!
See this thread for details.
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

For avoiding OutOfMemoryException

 
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

For avoiding OutOfMemoryException , i am setting ,

Xms=256m -Xmx=512m in Eclipse under Run --> External Tools --->Open External Tools Dialog --->Program --> New Configuration .




Am i doing the right way ? And More query is that How can i ensure that the Application is running with this configuraion ?


Please answer my these two queries . It would be a great help.
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What OS? On Linux use:

pf -es | grep java

On Windows, get Process Explorer from sysinternals.

Both will give you the full command line for your Java apps - then you can see what settings have been made.
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Peter as you suggested

i had downloaded Process Explorer . under eclipse.exe PID it is showing 728 .

I am confused . Please help.
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When do you get the OOME, when you run Eclipse itself, or when you're launching a program from within Eclipse?

If it is in Eclipse itself, then what you wrote above is not the correct way. Open the file eclipse.ini which is in your Eclipse installation directory with a text editor (Notepad for example) and add a "-Xmx..." line. This is, for example, what my eclipse.ini looks like (running Eclipse 3.4.2 on Windows XP):

-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256M
-framework
plugins\org.eclipse.osgi_3.4.2.R34x_v20080826-1230.jar
-vmargs
-Dsun.lang.ClassLoader.allowArraySyntax=true
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m


 
Saloon Keeper
Posts: 21127
131
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can also use the JMX jconsole app to check VM memory usage.

However, you've set up the memory parameters for one specific execution of the indicated Java application, operating as an external command invoked by Eclipse. External Tools aren't "Java apps". They can be any application executable at all, Java or not, including shell scripts. If you launch a Java application as an External Tool, the VM parameters you set on its command line will only apply when using that particular launch configuration. You can just as easily set up an alternate External Tool configuration that launches the exact same program but with entirely different VM parameters.

And neither of those sets of parameters would be applied when you launched the same application inside Eclipse's Run/Debug environment. Each Run profile has its own VM settings.
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

under eclipse.exe PID it is showing 728



You are not looking for eclipse .exe, you are looking for jave.exe. If there is no java.exe while your app is running, then you are running the app within Eclipse, in which case follow Jesper's recommendations.

If you do find java.exe, look at the Command Line column (you might have to add that column to the display), it shows you the full command line used to start the app. Do you see your memory setting there?
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Thank you all .

I found we can set xms and xmx values for a Program , a build.xml file(ANT file) and on debug configuration . Exactly on where should i set these values ??


Please help . Thanks in advance.
 
It's just like a fortune cookie, but instead of a cookie, it's pie. And we'll call it ... tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!