[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Tomcat memory keep growing

Posted on 2001-07-26
4
Medium Priority
?
511 Views
Last Modified: 2013-11-24
win2000/Tomcat/Apache

My situation is once I invoke a servlet, java.exe occupy more memory (from Task Manager). Normal right? But after the servlet done, memory does not be free.
i.e. java.exe memory usage keep growing.

the servlet involves fileoutputstream, printstream and file. I have closed the former two. But I don't know how to close the file.
i.e. I open the file but do not close it.
I think the memory leak problem may due to this.

Anyone please advise what is the problem? or I missed some settings in Tomcat...

Thanks
0
Comment
Question by:win97a
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 3

Accepted Solution

by:
black earned 100 total points
ID: 6325078
The file object does not need to be closed, only the streams i.e. your fileoutputstream and printstream.
I assume you are reading the input from the file and storing them as String objects, this tends to be a common cause of memory growth. If you have a profiler of the JVM try to get an object count and see which objects keep growing, I've experienced situations where due to debugging or reading file input the number of String objects keeps growing and uses up a lot of the memory.
Try using StringBuffers where you can and see if the memory usage declines.
0
 
LVL 1

Assisted Solution

by:googlyralph
googlyralph earned 100 total points
ID: 6327215
Hi,

a problem i was made aware of due to a freind working on tomcat is that there is a known memory leak on jdk1.3.1 this may account for your troubles? (assuming you are running 1.3.1 that is... ;-)

Googly Ralph.
0
 

Expert Comment

by:CleanupPing
ID: 9061952
win97a:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 9208315
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:


[split points between googlyralph and black]


Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
sudhakar_koundinya
EE Cleanup Volunteer
---------------------
If you feel that your question was not properly addressed, or that none of the comments received were appropriate answers, please post your concern in THIS thread.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question