• Post Reply Bookmark Topic Watch Topic
  • New Topic

gc() in tomcat linax server  RSS feed

 
kishor kalapa
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
I am working on a mvc project in that i'm try to use garbage collectiopn by calling runtime.getRuntime().gc() .when i run this project it running perfectly,but when i deploy on remote server(linax,tomcat5.0,java1.5) i am getting method notfound exception in the file in which i call gc()
Is gc() method not work on server or i need to call gc() method by useing System.gc() ?
please solve this problem
 
Nitesh Kant
Bartender
Posts: 1638
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Firstly, can you tell us a reason as to why you wish to explicitly call gc()?
Modern day JVMs are intelligent enough to decide when to call gc() and do not need the indication given by calling gc() [Calling gc() does not guarantee running gc but it is just an indication.] unless you are doubly sure you need it.

Can you give us the exception details, stacktrace, etc.? since gc() method is available in Runtime class, there is no reason it should throw this error.

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!