Hi,
I am facing memory leaks problem, but I am not able to find where it is.
Here is my situation:
I am developing a web application using JDeveloper 3.1, BC4J and JSP pages. The servlet container is Tomcat 3.2.1, running on a Windows 2000 Professional server, 256 MB RAM, Oracle 8.1.7
I have deployed 2 files: one .jar containing business components, another one containing JSP pages, web beans and ".properties" files.
In my "Package1_Package1Module.properties" file there are these settings:
ConnectMode=Local
JndiPath=test
ImageBase=/webapp/images
ConnectionName=conn2
HttpSessionTimeOut=30
IsStateLessRuntime=false
CSSURL=.
ApplicationModuleName=Package1.Package1Module
Well, after using the application for a while, the server memory is almost full (allocated). In other words, the "java.exe" process (held by Tomcat) continues growing, sometimes releasing a few MB, but still growing after requesting new pages or refreshing old one.
Java Garbage Collector seems to never be invoked.
Examing the memory allocation, I see the following:
1) When Tomcat starts, and there are no clients (browsers) open, the initial memory allocated by the "java.exe" process is about 13 MB. Correct.
2) When a first user opens a browser, and logs in, the Tomcat console says:
Loading from CLASSPATH Package1_Package1Module.properties
*******Package1_Package1Module - Session timeout is:30
and the memory allocated by "java.exe" process is now 42 MB.
3) I call this JSP page:
<jsp:useBean class="Package1.myDataWebBean" id="pan" scope="page">
<%
pan.initialize(pageContext,"Package1_Package1Module.qdata");
pan.render();
pan.setReleaseApplicationResources(true);
%>
</jsp:useBean>
The memory allocated by "java.exe" process is now 33 MB (something has been released).
4) I reload the above JSP page 10 times: the memory allocated by "java.exe" process grows of about 1MB, then returns stable on about 33 MB.
5) I open another browser, log in, and call the JSP page seen above. The memory allocated by "java.exe" process is incremented to 35 MB. 2 MB of memory seems too much...
6) I reload the page 10 times: the memory allocated by "java.exe" process grows of about 1MB, then returns stable on about 35 MB.
7) I wait for 30 seconds: the first session expires for timeout. The Tomcat console says:
************* AM was releasedPackage1.Package1ModuleImpl@4597
The memory allocated by "java.exe" process is still at 35 MB.
Well, questions are:
- is my application using Application Pooling instances?
- is it correct this heavy memory increasing due to first user connection?
- why every time I call a page which uses <jsp:useBean> memory increases of 2 MB and it is never released?
- why memory is not released when session ends?
Waiting for your answers or suggestions.
Thank you.