groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Price <>
Subject Groovy Script Memory Management Anti-patterns
Date Mon, 21 Nov 2016 20:52:17 GMT
Good afternoon, all.  I've a Groovy script with what might be a code caused
memory leak, but I can't find the cause.  Basically, I'm using a script to
take 2 GB chunks of data from a SQL Server DB, manipulate it, then insert
it into a different SQL Server DB.  I've a few scripts that do this using
Groovy SQL, and the others work well, but this one always ends in a Java
heap OOME.  The difference, I think, is that this script is migrating a lot
more data (TBs), so it runs much longer.

I've done heap dump analysis, but I'm not ready to get into the details of
that yet.  Seems the script might be holding onto every invocation of:

List datalist = sourceDB.rows("${Sql.expand getDataQuery}")

even though I've been careful to use static variables as well as dataList =

I'm starting to think I'm missing something fundamental, rather than just a
coding error.

Any advice appreciated...


View raw message