SUGGESTED FIX
David Holmes has provided this correct resolution.
http://jpsesvr.sfbay.sun.com:8080/ctetools/html/ViewDetail.jsp?index=2799
|
|
|
SUGGESTED FIX
Correction, there is no suitable operator delete in ResourceObj in JDK5. The correct fix here is to define ResourceObj::operator delete(void* p) to perform FreeHeap(p) when called on an object that was allocated in the C_Heap.
Caution: there may be existing code that calls delete on non-C-heap allocate dobjects. These calls need to be removed.
|
|
|
SUGGESTED FIX
Looking at this again it seems that there is a correct operator delete so the fix should only need to be:
+ delete _methods;
+ delete _bcis;
|
|
|
WORK AROUND
Use Java 6 if possible
|
|
|
EVALUATION
The originator is correct. The GrowableArray objects are not being freed and so a leak is occuring.
This does not occur in Java 6 as the means by which stacktraces are put together is quite different.
|
|
|
SUGGESTED FIX
*** /tmp/geta10923 Wed Sep 13 20:53:43 2006
--- threadService.cpp Wed Sep 13 20:53:38 2006
***************
*** 295,300 ****
--- 295,302 ----
ThreadStackTrace::~ThreadStackTrace() {
_methods->clear_and_deallocate();
_bcis->clear_and_deallocate();
+ ::delete _methods;
+ ::delete _bcis;
}
|
|
|
WORK AROUND
CUSTOMER SUBMITTED WORKAROUND :
For the current thread, use java.lang.Throwable.getStackTrace() instead of java.lang.Thread.getStackTrace().
|
|
|