[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-openjfx-dev
Subject:    Re: Unused members in JMemoryBuddy
From:       Nir Lisker <nlisker () gmail ! com>
Date:       2022-01-22 10:54:22
Message-ID: CA+0ynh9Qs_Ge6YbDC2bdpHN9djsk4OcZFAko1USEg5YBBcYa7g () mail ! gmail ! com
[Download RAW message or body]

Got it, thanks.

On Fri, Jan 21, 2022 at 11:08 AM Florian Kirmaier <
florian.kirmaier@gmail.com> wrote:

> Hi Nir Lisker,
>
> Yes, these are required.
> Btw, here is the link to the project, which can be used independently of
> OpenJFX: https://github.com/Sandec/JMemoryBuddy
>
> > * line 89: AssertCollectable assertCollectable = new
> AssertCollectable(weakReference);
> This is useful to find the reference, which was not collectible. You can
> just search the heap for the class "AssertCollectable" and find the
> troublemaker. This really speeds up debugging failing tests.
>
> > * line 237: the method setMxBeanProxyName
> This was provided by someone to the original project. This makes it
> possible to configure the "createHeapDump" method to work with different
> JVMs.
>
> > * line 309: setAsReferenced
> You are right, this is only used to make sure a certain reference will not
> be collected.
> This way, it's possible to define a set of objects which are referenced,
> and then check whether certain objects are still collectible.
>
> Florian Kirmaier
>
> On Fri, 21 Jan 2022 at 08:07, Nir Lisker <nlisker@gmail.com> wrote:
>
>> Hi,
>>
>> Looking at JMemoryBuddy, there are unused fields and methods. It's not
>> clear if they were left in by mistake or are part of future work.
>>
>> * line 89: AssertCollectable assertCollectable = new
>> AssertCollectable(weakReference);
>> * line 237: the method setMxBeanProxyName
>> * line 309: setAsReferenced
>>
>> The last one is part of the class SetAsReferenced, which is used in the
>> memoryTest method's  setAsReferenced, but the list it is added to is never
>> read from. Could be that it just holds references so that they won't be
>> collected.
>>
>> Are these needed?
>>
>> - Nir
>>
>
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic