• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

heap size

 
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
my application is throwing a java.lang.OutOfMemoryError and i would just like to know how to be able to tell how much your heap size is using the command line since it is on linux and how to increase the heap size?
java -Xms32m -Xmx256m does not work
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What container are you using?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Java itself provides some nice tools for montitoring memory usage.
I have a link that lists all of them on my workstation at the office.
I'll post it later today.

I've been playing with JConsole (ships with JDK1.5.0) lately. It's vey nice.
 
Bernard Sigmund Gustav
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Ben.

Sorry for the late reply, I got sick.
Anyway, I am using Tomcat 4.1 deployed on Linux.
Since I was not able to find a solution that day, I just restarted the server.
But it might still recur in the future
 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am also using tomcat on linux, tomcat 5 on FC4. Although I do not know the nature of your application, I think 256 is a relatively small amount of memory.

I am able to increase the heap by changing the catalina opts var.

export CATALINA_OPTS=" -Xmx1664M -Djava.awt.headless=true ..."

Use the "top" command to check the memory in use. Press "Shift+M" to sort by memory. You can use top -p <pid> to monitor only the java process. Linux offers some other tools for process and system health monitoring.
[ November 07, 2006: Message edited by: Rashid Mayes ]
 
Bernard Sigmund Gustav
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks. will try this if it works and will just update you.
thanks again
 
reply
    Bookmark Topic Watch Topic
  • New Topic