Menu

Jpype memory usage issue

Feedback
ginger956
2012-12-16
2015-06-13
  • ginger956

    ginger956 - 2012-12-16

    Hi,

    I got the Jpype run smoothly except it takes up ram slowly when it runs for a long time. I need to make repeated calls of the java methods for at least 100 thousand times and it consumes all the ram space and reports the following message: Fatal Python error: PyEval_SaveThread: NULL tstate. 

    My question is that is it a problem of memory leak? If so how should I solve it? I tried to use System.gc() to release the garbage, but it doesn't help much. I read through previous threads and noticed there was a discussion on memory leak, but not sure it has been fixed on the Jpype. I am using JPype-0.5.4.2.win-amd64-py2.7.‌exe

    For instance, if I run 10 thousand iteration of the following method, the ram could be steadily, though slowly, increasing in usage.

    def  analyze(var):
        Library = JPackage("edu").Toolkit.getInstance().getLibrary()   
        options = JPackage("edu").cornell.rdsat.api.beans.PartitionAnalysisOptions()

    Thank you for any help!
    Yongren

     
    • -

      - - 2015-06-13

      Hi, would you happen to still have a copy of JPype-0.5.4.2.win-amd64-py2.7.exe? I've been looking to find that file but it seems nowhere to be found on the internet! If you wouldn't mind sharing it I would be very grateful.

       
      • Steve Menard

        Steve Menard - 2015-06-13

        You should contact the new maintainers of jpype on github at originell/jpype

        Steve Menard


        Programming today is a race between software engineers striving to build
        bigger and better idiot-proof programs, and the Universe trying to produce
        bigger and better idiots. So far, the Universe is winning.
        Rick Cook, The Wizardry Compiled


        There are two major products that come out of Berkeley: LSD and UNIX. We
        don't believe this to be a coincidence.
        -- Jeremy S. Anderson

        On Fri, Jun 12, 2015 at 8:43 PM, Mehrdad N. wfunction@users.sf.net wrote:

        Hi, would you happen to still have a copy of
        JPype-0.5.4.2.win-amd64-py2.7.exe? I've been looking to find that file but
        it seems nowhere to be found on the internet! If you wouldn't mind sharing
        it I would be very grateful.


        Jpype memory usage issue
        https://sourceforge.net/p/jpype/discussion/379372/thread/807a7fcc/?limit=25#418a/e52b


        Sent from sourceforge.net because you indicated interest in
        https://sourceforge.net/p/jpype/discussion/379372/

        To unsubscribe from further messages, please visit
        https://sourceforge.net/auth/subscriptions/

         
  • Steve Menard

    Steve Menard - 2012-12-17

    There could very well be a small memory leak. From the error you mention the leak is most likely in the python side rather than the java, so calling System.gc would not help.

    Unfortunately short of diving deep into the code there isnt much you can do to fix it. I have run tests will many thousands of calls, sorhe leak doea not happen every time.

    I can't check right now, but if there is a way to give more memory to the python VM, that could let you run you program to completion.

     

Log in to post a comment.

MongoDB Logo MongoDB