• 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

OutOfMemoryError

 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I use a Asterisk-JAVA API program which on a random basis, calls a Servlet, using Tomcat5, in order to set forwarding of calls through an Asterisk Server.
An hour after the program has been run, it gives an OutOfMemoryError - and hence the servlet is not called and hence CallForwarding is not set. But again randomly, it works but other times sends an OutOfMemoryError.
On the start of the program, I check the

Runtime.getRuntime().totalMemory() --> arnd 1.9 MB
Runtime.getRuntime().maxMemory() --> arnd 64 MB
Runtime.getRuntime().freeMemory() --> arnd 1.4MB


After the totalMemory reaches 64 MB, and freeMemory is less than 34556 bytes, the java.lang.OutOfMemoryError is thrown.
Since I am completely new to both JAVA and tomcat, I would like to know how I need to proceed. I believe I must increase the maxMemory -- but how and where?
I start Tomcat5 using /etc/init.d/tomcat5 start command.
I run the JAVA program using Netbeans IDE 4.1

Kindly guide me further. Any help appreciated.
Thanks in advance
Aparna
 
Ranch Hand
Posts: 775
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sun has documentation you can download for the JDK you are using. You'll find a section in that on "tools", with platform-specific pages for Windows, Solaris, etc. The command-line arguments for specifying memory are described there.
 
Aparna Ram
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Reid,
Thanks. But I use Netbeans IDE to run the program, so I dont get to start the program via command line. In this case- how do I set up the JVM options?
Thanks
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As this seems to be Netbeans question I'm moving this to our IDE forum...
 
Aparna Ram
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can somebody help me with this query??
 
An elephant? An actual elephant. Into the apartment. How is the floor still here. Hold this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic