Unused members in JMemoryBuddy
Nir Lisker
nlisker at gmail.com
Sat Jan 22 10:54:22 UTC 2022
Got it, thanks.
On Fri, Jan 21, 2022 at 11:08 AM Florian Kirmaier <
florian.kirmaier at 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 at 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
>>
>
More information about the openjfx-dev
mailing list