memory « Development « JSP-Servlet Q&A

1. What happens when a JSP finishes execution?

When a JSP finishes execution, will all variables declared in the JSP page be put up for garbage collection? If I declare a number of memory intensive Hashtables in the JSP, ...

2. Possible memory leaks on a plain jsp site

First of all, I lie, it's not really a plain jsp website. It has a couple of pages with database access and a lucene based search engine... and around 400 standalone ...

3. Is Java File object from a MultipartRequest written to disk as temp file or stored in memory?

If I accept a file from a MultipartRequest and call

File f = request.getFile("fileName");
Is the file written to disk (as a temp file) or is it only stored in memory at this ...

4. Write wave files to memory in Java

I'm trying to figure out why my servlet code creates wave files with improper headers. I use:

  new AudioInputStream(
  new ByteArrayInputStream(memoryBytes), new AudioFormat(22000, 16, 1, true,false), memoryBytes.length

5. What's the (memory) footprint of a J2EE servlet?

For Jetty, Tomcat, or any other servlet container of your choice, what's the average footprint (memory, and any other notable resources) of a basic servlet? This includes any other basic objects ...

6. Servlet File Upload Memory Consumption

I'm using a servlet to do a multi fileupload (using apache commons fileupload to help). A portion of my code is posted below. My problem is that if I ...

7. Garbage collection of pagecontext attributes java


pageContext.setAttribute("name", new String("Shal"));
String name1= new String("Jason");
pageContext.setAttribute("Alternate Name", name1));
how the memory is allocated for the above two attributes,how and when that memory allocated will be recovered. What is the best practice to ...

8. Can a JNDI lookup in a Servlet cause a permgen memory leak?

Since JBoss 4.2 does not support @EJB injections, I am using a JNDI lookup to reference an EJB that is needed by a Servlet. I am concerned that this type of lookup ...

9. How to Profile JVM memory in the code?

I am writing a servlet that I can't test in Eclipse, I need to run on server. I want to do memory profiling and pinpoint any leaks. So, I think I ...

10. A web application appears to have started a thread named [22] but has failed to stop it. This is very likely to create a memory leak

I have a web application with Servlets in the back end deployed over tomcat. The application is simple java application. I see this error frequently in the server logs: SEVERE: A web ...

11. JMX: How to prevent Classloader memory leaks in a servlet container?

I am wondering if or how I should deal with MBeans which are registered directly or indirectly from my application which gets deployed on a servlet container. In most cases there are ...

12. Sun Web Server 7 Serving .jsp - Eden Space Behavior - Possible Memory Leak

My company has recently moved to Alfresco as a content management solution. As some of the content is dynamic (a .jsp file that is included in another .jsp reads a sitemap ...

13. Including lots of jspf files in a jsp file causes high memory usage

We have a web page, running on a glassfish server. In our jsp file we have a lot of includes like the one below.

<jsp:directive.include file="johndoe/foobar.jspf"/>
These files are included according to the ...

14. Out of Memory Error

15. Prepares Statement : Shared Memory error

Hi all i am trying to use the following Prepared statement for an Update statement. when i am executing this, SQL server 2000 gives me an error saying some shared memory. The question is is it possible to use update query with prepared statement. My code is as follows <%@ page import="java.sql.*" %> <%@ page import="java.util.*" %> <%@ page import="java.lang.*" %> ...

16. Memory leaks

17. question on memory usage

18. Out of memory problem !

I have only really seen this error when there is something like an infinite loop which is results in the creation of a large number of object instances. I'd have a good look at the JSP code, suggest that you post it's contents here if it's not too large. If it is large then try commenting out various bits of the ...

19. Adjusting Memory JVM in JSP

20. JSP - Out of Memory exception

22. Possible memory leak?

Our application, which is running on tomcat 5.0.25, linux 3.0ES, continues to increase it's memory consumption over time until tomcat is recycled. Do we have a problem with the garbage collector? Or a memory leak? Has anyone else experienced a similar issue and what was done to correct it? Thanks so much for your help!

23. Out Of Memory Error

24. Lines of exhausted and out of memory

Hi All, Thanks in advance. I have one jsp in which i need to incorporate somany functionalities and it is using JSTL we are coding and its a completely a dynammic output to the browser depending upon certain condition. While coding around 4000 line coding the jsp is not allowing to code.And giving the error that out of memory and couldnt ...

25. Page memory problem

27. Memory Leak in JSP?

28. Memory Leaks in Servlets/JSP

29. Servlets & global stateful in-memory objects

I have a web application that basically acts as a batch process starter. I have long batch processes that I dispatch off to threads, the servlet call that kicks this process off returns after setting up the batch process and creating the 'worker' thread. So long after the servlet has done its HTTP work, the worker thread the servlet created is ...

30. How Remove Servlets From Server Memory

31. JSPs using a large amount of memory

Hi everyone, I'm having a performance problem with the JSPs in my applicaiton. During performance testing I found that my application's JSPs were using a little less then 80% of the heap in my JVM (and garbage collection is the bottle neck in my application's performance). I used JProfiler and it showed me that the majority of this memory was used ...

32. Out of memory error in JSP

34. View memory of objects and data

36. Memory leakage Problem in java/servlet

Hello, I am struggling with a problem for the last few days. It is a web application in which we have options for uploading data from excel,doc .. files etc to database. The excel file may contain more than 1000 records. I am using good processor and 1GB memory. The problem is that after doing 300 records , i can see ...

37. Out of Memory in heap-need solutions

38. [SOLVED] Servlet memory management

I have a simple servlet with service and init method. i run this servlet in tomcat server. when i view memory usage using Jrockit mission control i observe the memory keeps going up and comes down after some time(when GC is called). the memory graph looks like a steps going up and fall down after some time and again goes up. ...

39. Servlet memory management

40. memory leak requesting servlet

42. Download Servlet throwing Out Of Memory Exception

- get rid of this setting file to null and System.gc garbage - set the content length with the length of the File. you already have the file object this isn't hard - I wonder what doZip is really doing. And I wonder why you don't just zip the content as you go. Would certainly be faster then what you are ...

43. out of memory error in jsp

Hi, I am trying to populate a huge object[] in a jsp. it's length is appx. 350 and each array again holds an object[] in itself. So it is a rather complex and huge array that i am trying to display thru jsp but i end up with out of memory error. I am only able to display upto around 100 ...