Out of Memory in Tomcat

This are the things i am doing in JSP

Using Bean i get Image in byte[].

Then i will send Image as response using < page ... Directive.

Everything is running fine but the problem is after transferring 25 images......

i get Out of Memory Exception.

The reason is TOmcat Process is consuming more and more memory.

It is in ratio to images sent.

How should i free the memory?

I tried byte[] as local and Session variable.

Even then it consumes more and more memory.

[526 byte] By [jimi.sonia] at [2007-10-2 13:00:42]
# 1
Increase the heap size e.g. -ms250M -mx512M.You can set these parameters in catalina.bat file.Also I feel that there is memory leak in your code. Why dont you try setting the objects to null once they are used?
javagalaxy.coma at 2007-7-13 10:20:44 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
I agree,With Java's garbage collection, once it knows that the objects are done being used it will free up the memory. Setting them to null would accomplish this.Mitch
mgillespa at 2007-7-13 10:20:44 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
Thanks to both of you.I think the problem was, I was using one page for both tasks.That could be the reason for out of memory.Now i am having two pages.One for selection of IP and second for displaying the screen of that perticular IP.Thanks again.......
jimi.sonia at 2007-7-13 10:20:44 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...