Project: AspectJ
Bug 59909 CFlowStack removesThreads to late
Reported: 2004-04-26 05:40:05 | Status: resolved fixed

Problem: The current implementation of CFlowStack (Version 1.1-till 1.2 rc1) stores all threads in a hashtable. These Threads are removes after several calls to the methods getThreadStack(). (In our cases >70 calls.) In our project, this cycle is much to long. We have soveral long running threads, which grap quite a lot of lot of memory. This memory can only be freed after the threads have been removed from the CFlowStack. In our production code we sum up to more than 300 Threads stored in different CFlowStack Varaibles. Often this results in out of memory Errors. Added patch provides an improved freeing scheme. It checks if the size of the table has grown, if it has, it checks if it can remove some threads.

Files changed in fix:
runtime/src/org/aspectj/runtime/internal/CFlowStack.java runtime/src/org/aspectj/runtime/internal/cflowstack/ThreadStack.java runtime/src/org/aspectj/runtime/internal/cflowstack/ThreadStackFactory.java runtime/src/org/aspectj/runtime/internal/cflowstack/ThreadStackFactoryImpl.java runtime/src/org/aspectj/runtime/internal/cflowstack/ThreadStackFactoryImpl11.java runtime/src/org/aspectj/runtime/internal/cflowstack/ThreadStackImpl11.java