Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The server schema implementation creates memory/resource leaks #123

Open
jonasbjurel opened this issue Aug 16, 2024 · 0 comments
Open

The server schema implementation creates memory/resource leaks #123

jonasbjurel opened this issue Aug 16, 2024 · 0 comments

Comments

@jonasbjurel
Copy link
Owner

jonasbjurel commented Aug 16, 2024

Describe the bug
The server schema implementation creates memory/resource leaks, since it creates references to it's parent object which are not released, thus the gc will never collect the parent object.

To Reproduce
Delete an object, the destructor will not be ran, and there are multiple references let to the decoder object:
gc.get_referrers(self.decoders.candidateValue[0])
[{'dirty': False, 'truelyDirty': False, 'parent': <decoderLogic.decoder object at 0x000001FD3A44AE00>}, {'dirty': False, 'truelyDirty': False, 'parent': <decoderLogic.decoder object at 0x000001FD3A44AE00>}, {'dirty': False, 'truelyDirty': False, 'parent': <decoderLogic.decoder object at 0x000001FD3A44AE00>}, {'dirty': False, 'truelyDirty': False, 'parent': <decoderLogic.decoder object at 0x000001FD3A44AE00>}, {'dirty': False, 'truelyDirty': False, 'parent': <decoderLogic.decoder object at 0x000001FD3A44AE00>}, {'dirty': False, 'truelyDirty': False, 'parent': <decoderLogic.decoder object at 0x000001FD3A44AE00>}, {'dirty': False, 'truelyDirty': False, 'parent': <decoderLogic.decoder object at 0x000001FD3A44AE00>}, {'dirty': False, 'truelyDirty': False, 'parent': <decoderLogic.decoder object at 0x000001FD3A44AE00>}, {'dirty': False, 'truelyDirty': False, 'parent': <decoderLogic.decoder object at 0x000001FD3A44AE00>}, {'dirty': False, 'truelyDirty': False, 'parent': <decoderLogic.decoder object at 0x000001FD3A44AE00>}, {'dirty': False, 'truelyDirty': False, 'parent': <decoderLogic.decoder object at 0x000001FD3A44AE00>}, {'dirty': False, 'truelyDirty': False, 'parent': <decoderLogic.decoder object at 0x000001FD3A44AE00>}, {'dirty': False, 'truelyDirty': False, 'parent': <decoderLogic.decoder object at 0x000001FD3A44AE00>}, {'dirty': False, 'truelyDirty': False, 'parent': <decoderLogic.decoder object at 0x000001FD3A44AE00>}]

Expected behavior
Shema should not prevent an object to be destroyed by the gc.

Screenshots

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context

Temporary workaround:
In topDecoderLogic.py:
def delChild(self, child):
child.aboutToDeleteWorkAround() #WORKAROUND CODE FOR ISSUE #123

In decoderLogic.py:
def aboutToDeleteWorkAround(self): #WORKAROUND CODE FOR ISSUE #123
self.parent.decoderMacTopology.removeTopologyMember(self.decoderSystemName.value)

The workaround above only shows the decoder, same workaround have been applied to all MOs.

This workaround fixes the logic, but does not prevent memory/resource leaks when objects using schemas are deleted.

jonasbjurel added a commit that referenced this issue Aug 16, 2024
Issue #123 - temporary workaround implemented - still memory/resource
leaks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant