United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6200343 memory leak in many jni calls (NewString etc.)
JDK-6200343 : memory leak in many jni calls (NewString etc.)

Details
Type:
Bug
Submit Date:
2004-11-25
Status:
Resolved
Updated Date:
2010-05-11
Project Name:
JDK
Resolved Date:
2004-12-21
Component:
deploy
OS:
solaris_10
Sub-Component:
plugin
CPU:
sparc
Priority:
P2
Resolution:
Fixed
Affected Versions:
5.0
Fixed Versions:
5.0u2 (b04)

Related Reports
Backport:
Backport:

Sub Tasks

Description
In deploy/src/plugin/solaris/nscore/remotejni.cpp, there are several places where call malloc but don't call free. The affected methods are:

jni_CallStaticVoidMethodV
DEFINE_CAPTURESCALARARRAYELEMENTS
DEFINE_SETSCALARARRAYELEMENTS
jni_NewString
jni_NewStringUTF
jni_CSecurityContextImplies

When doing liveconnect call, mozilla will call jni_NewString to convert js string to java string, sometimes, the js string is very large, it will cause serious mozilla memory growth.

This problem also exists in 1.4.2.


                                    

Comments
EVALUATION

DEFINE_CAPTURESCALARARRAYELEMENTS does not call memory leak, the memory allocated by it will be release by other JNI function.  Other functions actually cause memory leak. Also there some mismatched AddRef() and Rlease() , they cause memory leak too
###@###.### 2004-11-25 09:30:48 GMT

some leaks also exist in server.c
###@###.### 2004-11-30 11:05:14 GMT
                                     
2004-11-25



Hardware and Software, Engineered to Work Together