#8 Memory-Leak in JNative.invoke()

closed
Native side (6)
5
2007-05-07
2007-04-11
No

Hi Marc,
I recognized an Memory leak in the JNative.invoke() method.
By using the JNative.invoke() method in different methods, calling different functions in the native dll, the memory increases continously by about 50KB to 80KB per call.
Sorry, but I have no example available, but try your "FreeSpaceAvailable"-Example, call it for more than one time and watch the memory usage increasing.

Nevertheless... Great work, great project!
Thanks!
Carsten

Discussion

  • Marc DENTY

    Marc DENTY - 2007-04-25

    Logged In: YES
    user_id=84736
    Originator: NO

    Need to have time to reproduce.

     
  • Marc DENTY

    Marc DENTY - 2007-04-25
    • assigned_to: nobody --> mdenty
     
  • Nobody/Anonymous

    Logged In: NO

    I have experienced the same problem.

    Look at line 290 in org_volks_jnative_JNative.cpp, function Java_org_xvolks_jnative_JNative_nInvoke

    cParameters[i] = (char*)env->GetByteArrayElements(jParameters[i], &b);

    This should be followed with a call to ReleaseByteArrayElements

     
  • Marc DENTY

    Marc DENTY - 2007-05-07
    • status: open --> closed
     
  • Marc DENTY

    Marc DENTY - 2007-05-07

    Logged In: YES
    user_id=84736
    Originator: NO

    This bug was fixed thanks to an anonymous post please see it at :
    http://sourceforge.net/forum/message.php?msg_id=4291288

    I have copied exactly the sugested fix.

    Best,

    --Marc

     

Log in to post a comment.