tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject [OT] Re: Out Of Memory - String Operation
Date Fri, 28 Jul 2006 17:02:05 GMT
Viks,

> My app is running out of [memory].
> 
> Code does a lot of string opeartion. It involves fetching records
> from DB.

[snip]

> For around 100k records my apps goes down on memory.
> 
> Wondering if the app is able to sustain on String Obj why it is going
> down with StringBuffer Objects.

Do you have everything in one big method? If so, you might be collecting
local variables that cannot be GC'd, and so you're essentially leaking
memory.

I assume your program is something of the form:

conn = getConnection
ps = conn.prepareSatement
rs = ps.executeQuery

while(rs.next)
{
    // Do some stuff
}

Do you retain any data across each of the loop iterations? For example,
are you keeping an array/map/list/whatever of information around that
includes data from each row? If so, you may be simply running out of
memory. Do you know what the memory settings are for your JVM?

-chris


Mime
View raw message