Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • 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
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

heap space

 
Ranch Hand
Posts: 1329
3
Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I get the error:



I know that in order to fix it I need add something like java but in which file should I add something like this ?



Regards
 
best scout
Posts: 1294
Scala IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Depending on what type of application you are talking about you can simply add this parameter to the 'java' command like 'java -Xmx1024m your.class.name.here'. For other environments like application servers etc. there are usually different configuration files where you can specify these settings. You can also specifiy the heap size if you start a Java application from within an IDE.

Marco
 
Angus Ferguson
Ranch Hand
Posts: 1329
3
Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am using Eclipse. I have put in the Eclipse.ini java -Xmx2000m But it continues with the error


Regards,
 
Marco Ehrentreich
best scout
Posts: 1294
Scala IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are 2 possible reasons why it didn't fix the problem:

1) Your application really needs more memory (withour more details impossible to say). What do you think?

2) Now only Eclipse (the IDE) uses more memory but the applications you start from Eclipse use other settings. Unfortunately I don't have an Eclipse installation here to check where you can explicitly specify the JVM settings for a specific application. It's somewhere in the run configuration dialogs.


Marco
 
Angus Ferguson
Ranch Hand
Posts: 1329
3
Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

for example how I will increase it using Tomcat 7?

Regards,
 
Marco Ehrentreich
best scout
Posts: 1294
Scala IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My preferred way to configure Tomcat is to use the CATALINA_OPTS environment variable. For Linux systems you can add something like export CATALINA_OPTS="-Xmx1024m" to your bashrc script. On Windows you can add the variable like any other environment variable.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!