doing many thousand iterations of the problematic code path using external api and verifying the vm memory usage after a few gc cycles usually identifies a memory leak. see an example here: https://github.com/apache/activemq/blob/57795bafcea290c6879bb288822435c480a9212d/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ4930Test.java#L120
it is not very elegant, you have to leave some wiggle room, but it is effective. On Tue, 10 Jul 2018 at 06:37 Avikash Mishra <avimis...@gmail.com> wrote: > Hi Gary, > > The issue I’m trying to fix is a memory leak in ProtocolConverter.java > I can’t seem to find any tests that use this file or the > StompSubscription.java file. > > The problem is the pedingAcks array in ProtocolConverter.java is not > getting cleaned up when we ACK in client mode. The garbage collector does’t > clean this up ether. > > All the tests are only checking the responses and not the internal > workings. > > Do you know how I could go about writing a test for this case? > > Thanks > Avikash > > On 4/07/2018, at 10:07 PM, Gary Tully <gary.tu...@gmail.com> wrote: > > > > see: org.apache.activemq.transport.stomp.Stomp12Test > > > https://git-wip-us.apache.org/repos/asf?p=activemq.git;a=blob_plain;f=activemq-stomp/src/test/java/org/apache/activemq/transport/stomp/Stomp12Test.java;hb=HEAD > > > > On Tue, 3 Jul 2018 at 23:47 Avikash Mishra <avimis...@gmail.com> wrote: > > > >> Hi Gary, > >> > >> Thanks for your reply. > >> Is there any tests I can leverage off? I need to test the > >> onStompMessageAck method in StompSubsrcription.java class. > >> Or if you can point me in the right direction. > >> > >> Thanks > >> Avikash > >>> On 3/07/2018, at 9:14 PM, Gary Tully <gary.tu...@gmail.com> wrote: > >>> > >>> please add a unit test that will demonstrate the problem and fix and > also > >>> protect it. > >>> > >>> On Tue, 3 Jul 2018, 06:04 Avikash Mishra, <avimis...@gmail.com> wrote: > >>> > >>>> Hi there, > >>>> > >>>> We have been having the issue mentioned here > >>>> https://issues.apache.org/jira/browse/AMQ-7006 > >>>> > >>>> I have attached a patch. Please review and get back to me asap. We > have > >>>> tested this on our test environment and all seems to work fine and > fixes > >>>> the issue we are having. Would like to create my own fork and commit > >> please. > >>>> > >>>> Thanks > >>>> Avikash > >> > >> > >