[jbossts-issues] [JBoss JIRA] Commented: (JBTM-555) make memory leak tests more robust

Jonathan Halliday (JIRA) jira-events at lists.jboss.org
Wed Nov 18 12:39:29 EST 2009


    [ https://jira.jboss.org/jira/browse/JBTM-555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12495378#action_12495378 ] 

Jonathan Halliday commented on JBTM-555:
----------------------------------------

opted to use jboss profiler agent to force GC via the JVM TI.  This only works on selected platforms where the agent binary is available, so also moved the tests that need it to their own group so they can be run separately.

use http://www.jboss.org/jbossprofiler/downloads/jboss-profiler-1.0.CR4.zip to compile additional agents if new platform support is needed for the tests.

> make memory leak tests more robust
> ----------------------------------
>
>                 Key: JBTM-555
>                 URL: https://jira.jboss.org/jira/browse/JBTM-555
>             Project: JBoss Transaction Manager
>          Issue Type: Task
>      Security Level: Public(Everyone can see) 
>          Components: Testing, Transaction Core
>    Affects Versions: 4.6.1
>            Reporter: Jonathan Halliday
>            Assignee: Jonathan Halliday
>             Fix For: 4.9.0
>
>
> Some tests in the txcore group attempt to detect memory leaks by
> setup
> System.gc()
> take memory reading
> doTransactionStuff
> System.gc()
> take another memory reading
> This is unreliable, as System.gc() is only advisory to the runtime. There is no way to FORCE gc from within the jvm. This causes the tests to be somewhat unreliable.
> Dirty tricks to work around this include running the tests with a small heap (-Xmx5m). With less free space to work with, the gc tries harder. On a default size heap it mostly ignores System.gc().  Unfortunately the test framework does not make it easy to set -Xmx on a per test / test group basis.
> Similar effect could perhaps be achieved by allocating all except a small portion of the available heap from within the vm using eg. new byte[].
> There is also the jvmti ForceGarbageCollection method, but that would require us to have a chunk of C code on each test platform, which is a pain.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jbossts-issues mailing list