SUGGESTED FIX
For the application server portion of the fix, here's the relevant information:
The fix was limited to a single file com/sun/corba/ee/internal/Interceptors/SlotTableStack.java.
One could check out the diffs in Bonsai at http://cvsync.red.iplanet.com/bonsai/cvsqueryform.cgi.
Or
Do the diffs manually by using (cvs branch name: iASDev_Branch) :
cvs diff -r 1.1.2.3 -r 1.1.2.4 SlotTableStack.java
I am attaching the review template and the diffs again for anyone who wants to see:
Module: orb
Review Template
---------------
Bug # : 4771005
Synopsys :orb: PIORB is slow when ClientRequestInterceptor is used
CTS Impact : None
Perf Impact : Yes
UI Impact : None.
Doc Impact : None
Brief description : (From Harold Carr's mail explaining the fix that he made)
SlotTableStack.pushSlotTable uses List.add which
causes existing elements to get shifted "right" causing the table to grow
without bounds and to hold onto data in those unbounded slots.
Also, popSlotTable did not null unused slots so any data they held
would be released. This behavior has been corrected.
Test Case:
This has been tested by the ORB SQE team. The details of the tests
can be got from the bug report and from the SQE team. No new tests
need to be written to test this on the appserver.
Diffs:
Index: SlotTableStack.java
===================================================================
RCS file:
/m/src/iplanet/ias/server/src/java/com/sun/corba/ee/internal/Interceptors/SlotTableStack.java,v
retrieving revision 1.1.2.3
diff -r1.1.2.3 SlotTableStack.java
112c112,122
< tableContainer.add( currentIndex, table );
---
> // NOTE: Very important not to always "add" - otherwise a memory leak.
> if (currentIndex == tableContainer.size()) {
> // Add will cause the table to grow.
> tableContainer.add( currentIndex, table );
> } else if (currentIndex > tableContainer.size()) {
> throw new org.omg.CORBA.INTERNAL("currentIndex > tableContainer.size(): " +
> currentIndex + " > " + tableContainer.size());
> } else {
> // Set will override unused slots.
> tableContainer.set( currentIndex, table );
> }
115a126
>
135a147
> tableContainer.set( currentIndex, null ); // Do not leak memory.
|