Menu ▾ ▴

#262 Possible memory leak

open
Core (462)
5
2012-12-29
2005-06-03
No

I've been using squirrel recently to run rather large
scripts, and as the script runs, the memory usage
climbs, it runs slower, and eventually there is an
OutOfMemoryError. Setting the JVM to use more memory
just delays the inevitable. I've tried running the
scripts in smaller chunks, and with each successive
chunk the performance is worse. If I close the
connection and get a fresh one, performance goes back
to normal. It seems like the JVM is hanging onto
objects for each statement executed, and doesn't
release them until the connection is closed. Run
500-1000 statements on the same connection to duplicat e.

Discussion

  • Mitch Ratisher

    Mitch Ratisher - 2005-06-03

    Logged In: YES
    user_id=1290769

    Just realized I should have given more info. Those are all
    insert statements, so no result sets are being generated (in
    the UI anyway), and I'm running with auto-commit enabled.

     
  • Colin Bell

    Colin Bell - 2006-10-31

    Logged In: YES
    user_id=233132

    Does the memory return if you click "Garabge Collect" on
    the System tab in the About Box dialog.

     
  • Colin Bell

    Colin Bell - 2006-11-02

    Logged In: YES
    user_id=233132

    Theres definitely a memory leak there. I can duplicate it.

     
  • Rob Manning

    Rob Manning - 2006-11-06

    Logged In: YES
    user_id=1287991

    I was running SQuirreL 2.3 final today and happened to be
    doing a large number of inserts as suggested in the original
    description. I saw the memory usage rise to 160 MB. And
    the GC kicked in periodically to take it back down to low
    one hundreds while processing inserts. Once the script was
    finished I click on the garbage can and say the memory usage
    go back down below where it started before running the
    script. I'm not saying that we couldn't be more efficient
    with object allocation. Maybe we would benefit from someone
    hooking it up to a profiler when they have some spare
    cycles. However, the memory rise appeared to me to be from
    temporary objects that were released when appropriate.

    Rob

     
  • Colin Bell

    Colin Bell - 2006-11-06

    Logged In: YES
    user_id=233132

    Thats interesting, it didn't return fully for me. Most of
    the way but not fully.
    It may be DBMS / JRE related. I was using MYSQL 5.06, MYSQL
    JDBC driver 5.0.4, JRE 1.5.0_06-b05 on Win 2000.

    I'll do some profiling when I get my new PC, I've done it
    previously on SQuirreL. It'll be after xmas
    before I get any real time to look at it.

     

Log in to post a comment.