Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 10331 Details for
Bug 59909
CFlowStack removesThreads to late
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Variant of the submitted test program.
TestThreadRunner.java (text/plain), 1.99 KB, created by
Andrew Clement
on 2004-05-06 05:11:50 EDT
(
hide
)
Description:
Variant of the submitted test program.
Filename:
MIME Type:
Creator:
Andrew Clement
Created:
2004-05-06 05:11:50 EDT
Size:
1.99 KB
patch
obsolete
>import java.util.*; > >public class TestThreadRunner extends Thread { > public TestThreadRunner() { > super(); > Count++; > } > > private List locall; > private static List l; > > > public static void main(String[] args) { > long maxMem = 0; > long max = 0; > long start = System.currentTimeMillis(); > for (int i = 0; i < 1000; i++) { > new TestThreadRunner().start(); > System.gc(); > // Keep track of max number of threads that are executing simultaneously (as long as finalize is > // being driven appropriately) > if (Count > max) max = Count; > > // Keep track of maximum memory we use > long mem = Runtime.getRuntime().totalMemory()-Runtime.getRuntime().freeMemory(); > if (mem>maxMem) maxMem = mem; > } > System.err.println("Using ThreadLocal mgmt = "+!org.aspectj.runtime.internal.CFlowStack.getThreadStackFactoryClassName().endsWith("11")); > System.err.println("Max memory used through the run = " + maxMem); > System.err.println("Time to execute the program = " + (System.currentTimeMillis() - start)); > } > > > static { > l = new ArrayList(); > for (int i = 0; i < 20000; i++) > l.add("thisisalongstringithinkaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); > > } > > public void foo() { > locall = new ArrayList(); > locall.addAll(l); > } > > public void run() { > foo(); > } > > public static long Count = 0; > > protected void finalize() throws java.lang.Throwable { > Count--; > //System.out.println("I have now threads "+Count+" Consumed Time "+all); > super.finalize(); > } > >} > >aspect RunCflow percflow(runexec()) { > > public pointcut runexec() : execution(public void TestThreadRunner.run()); > > long start, stop; > public static long longest = 0; > > public static long all = 0; > > Object around() : runexec() { > start = System.currentTimeMillis(); > Object obj = proceed(); > stop = System.currentTimeMillis(); > all = all + stop - start; > if ((stop-start)>longest) longest=(stop -start); > return obj; > } > >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 59909
:
9938
|
9939
|
10255
| 10331