Closed Bug 198647 Opened 17 years ago Closed 7 years ago

Running JRE Plugin causes leak of the Component Manager

Categories

(Core Graveyard :: Java: OJI, defect)

x86
All
defect
Not set

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: dougt, Assigned: alfred.peng)

References

Details

(Keywords: assertion, Whiteboard: edt_b3, Java1)

Attachments

(1 file)

When I run java, i see that an extra reference count is added to the component
manager an is never released.  This causes a warning assertion to be fired at
xpcom shutdown.
Blocks: 78861
attachment 118025 [details] contains a balance tree showing leaks caused by Java plugin

Keywords: assertion
OS: Windows XP → All
Whiteboard: edt_b3
*** Bug 123191 has been marked as a duplicate of this bug. ***
Whiteboard: edt_b3 → edt_b3, Java1
Need traction on this bug
Keywords: nsbeta1
Reporter,

Can you try out JRE 1.4.2 beta (download from http://java.sun.com/j2se/) and 
see if there is still a leak there?

Doug,
Could you please verify this bug, or tell me steps of how to test this by
providing the test case or something. I think we need debuggable to test this,
right.
Steps to verify:

+ install the JRE as suggested.
+ build mozilla.
+ set XPCOM_MEM_LEAK_LOG=leaks.log
+ run mozilla.
+ load a page with a java applet tag.
+ exit mozilla
+ paste the leaks.log file to this bug.
adt: nsbeta1-
Keywords: nsbeta1nsbeta1-
I will check it
Status: NEW → ASSIGNED
yes, I try jre1.4.2 build 27. there is also some memory leak

== BloatView: ALL (cumulative) LEAK STATISTICS

    
|<----------------Class--------------->|<-----Bytes------>|<----------------Objects---------------->|<--------------References-------------->|
                                              Per-Inst   Leaked    Total     
Rem      Mean       StdDev     Total      Rem      Mean       StdDev
   0 TOTAL                                          48     6284   138880     
137 (  566.23 +/-   847.77)  1038029      102 (  784.14 +/-  1330.16)
   1 AtomImpl                                       16       32     1477       
2 (  573.92 +/-   298.78)    35537        6 ( 1964.89 +/-  1209.15)
   2 BackstagePass                                  20       20        3       
1 (    1.80 +/-     0.84)       30        1 (    5.39 +/-     2.32)
  36 GlobalWindowImpl                              232      464        4       
2 (    2.50 +/-     1.05)    31461        2 (   18.31 +/-     7.02)
  60 NavigatorImpl                                  28       56        6       
2 (    2.30 +/-     1.34)       56        3 (    6.54 +/-     2.87)
  75 ScreenImpl                                     16       16        2       
1 (    0.67 +/-     0.58)       10        1 (    2.63 +/-     1.46)
  96 XPCNativeScriptableInfo                         8       64      319       
8 (   68.35 +/-    39.38)        0        0 (    0.00 +/-     0.00)
  97 XPCNativeScriptableShared                      76      684      392       
9 (   20.33 +/-     7.72)        0        0 (    0.00 +/-     0.00)
  99 XPCWrappedNative                               52      572      875      
11 (  225.87 +/-   137.70)    16339       11 (  404.42 +/-   193.02)
 100 XPCWrappedNativeProto                          28      224       95       
8 (   27.28 +/-    15.48)        0        0 (    0.00 +/-     0.00)
 120 nsAggregatePrincipal                           92      184        7       
2 (    2.83 +/-     0.94)     1083        1 (    4.74 +/-     1.72)
 140 nsBaseURLParser                                12       12        3       
1 (    1.80 +/-     0.84)     2807        1 (  118.22 +/-    65.68)
 156 nsCLiveconnect                                  4        4        1       
1 (    1.00 +/-     0.00)        2        1 (    1.33 +/-     0.58)
 215 nsCodebasePrincipal                            76      152        7       
2 (    2.83 +/-     0.94)      262        4 (    5.68 +/-     1.78)
 219 nsComponentManagerImpl                        240      240        1       
1 (    1.00 +/-     0.00)    16348        3 (    6.25 +/-     1.06)
 241 nsDOMClassInfo                                 20      140       29       
7 (   16.08 +/-     7.74)     5070       16 (   69.52 +/-    34.57)
 275 nsEntropyCollector                           1048     1048        1       
1 (    1.00 +/-     0.00)        4        1 (    1.71 +/-     0.76)
 322 nsHashKey                                       8      272    24849      
34 (  924.62 +/-   452.51)        0        0 (    0.00 +/-     0.00)
 323 nsHashtable                                    44       88      532       
2 (  220.29 +/-   124.70)        0        0 (    0.00 +/-     0.00)
 353 nsJSID                                         36       36       51       
1 (    8.23 +/-     4.55)      260        1 (   15.12 +/-     8.81)
 355 nsJSRuntimeServiceImpl                         24       24        1       
1 (    1.00 +/-     0.00)      102        1 (    8.93 +/-     2.38)
 356 nsJVMManager                                    4        4        1       
1 (    1.00 +/-     0.00)       32        4 (    3.03 +/-     1.72)
 366 nsLocalFile                                    80      320     1788       
4 (   99.70 +/-    44.85)    10074        4 (  108.03 +/-    48.69)
 370 nsMemoryImpl                                   68       68        2       
1 (    1.33 +/-     0.58)       18        2 (    4.85 +/-     1.31)
 394 nsPersistentProperties                         88       88       18       
1 (    6.51 +/-     3.79)       53        1 (    6.92 +/-     3.74)
 400 nsPluginHostImpl                              100      100        1       
1 (    1.00 +/-     0.00)       40        3 (    6.32 +/-     1.93)
 405 nsPrefBranch                                   68       68        8       
1 (    2.67 +/-     0.98)      278        1 (    8.06 +/-     2.65)
 407 nsPrefService                                  48       48        1       
1 (    1.00 +/-     0.00)     1009        1 (    9.45 +/-     3.39)
 454 nsSharedPrefHandler                            88       88        1       
1 (    1.00 +/-     0.00)        1        1 (    1.00 +/-     0.00)
 456 nsSimpleURI                                     4        4       15       
1 (    3.00 +/-     1.63)      205        1 (   15.32 +/-     6.08)
 462 nsStandardURL                                 196      196      732       
1 (  112.07 +/-    65.67)    10897        1 (  227.07 +/-   123.97)
 468 nsStringBundle                                 40       40       19       
1 (    7.16 +/-     3.98)      108        1 (   13.57 +/-     7.90)
 475 nsSupportsArray                                56       56      802       
1 (  183.91 +/-    88.56)    11645        1 (  248.10 +/-    79.89)
 482 nsSystemPrincipal                              64       64        1       
1 (    1.00 +/-     0.00)    14830        2 (   61.82 +/-    28.71)
 521 nsVoidArray                                     8       88    12941      
11 ( 2473.72 +/-  1233.61)        0        0 (    0.00 +/-     0.00)
 525 nsWindow                                      248      248       29       
1 (    9.67 +/-     6.50)    11154       13 (   44.89 +/-    15.72)
 533 nsXBLDocGlobalObject                           28       28       19       
1 (    9.76 +/-     5.42)     2065        1 (   26.21 +/-    10.23)
 550 nsXPCComponents                                48      288       19       
6 (    9.44 +/-     3.83)      346        6 (   27.74 +/-     9.36)
 558 nsXPCWrappedJSClass                            44       88       27       
2 (    9.65 +/-     3.55)      158        3 (   31.95 +/-    16.87)
 570 nsXULPDGlobalObject                            28       28        2       
1 (    1.33 +/-     0.58)      122        1 (   15.62 +/-     8.72)
 583 xptiInterfaceInfo                              20       40      699       
2 (   55.52 +/-    54.46)     4776        2 (  100.82 +/-    72.55)

sorry for the format,
contrast to the situation that have not used java, I only found
nsHashKey/nsHashtable 's leak is relate to Java
Try uninstalling java.  From what I remember, most of those leaks are related to
the JRE plugin holding onto references when loaded.
Joshua, you may need to file a bugtraq bug for this. Thanks!
OK, I also check OJI. I think nsHashKey/nsHashtable 's leak is from OJI/ProxyJNI.cpp
->kyle
Assignee: joshua.xia → kyle.yuan
Status: ASSIGNED → NEW
I tested with JRE 1.5 which hasn't shipped yet. The problem seems gone.
Attached file nsPluginHostImpl.tree
compare the leak.log (with and without java plugin installed), the following
object leaked when java plugin (1.4.2) installed: 
nsComponentManagerImpl, nsJVMManager, nsHashtable, nsLocalFile,
nsPluginHostImpl, nsVoidArray

when switched to jre1.5.0, leaking of nsJVMManager is gone, but same results
for other objects.

attached balance tree shows the nsPluginHostImpl was Addref 3 times when call
JavaPluginFactory5::Initialize which is inside JPI code.
bug 88311 is for the same thing.
Assignee: yuanyi21 → pete.zha
mass reassign to Alfred
Assignee: zhayupeng → alfred.peng
Kyle in comment #17
> bug 88311 is for the same thing.

Kyle,
are you saying 88311 is a dupe?
or do you mean it is the same _type_ of thing?

Assignee: alfred.peng → nobody
QA Contact: dsirnapalli → java.oji
Assignee: nobody → alfred.peng
Product: Core → Core Graveyard
OJI is gone.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.