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 temporary copy of library is not deleted when Library object is released #166

Open
chanqueo opened this issue Feb 14, 2023 · 4 comments

Comments

@chanqueo
Copy link
Contributor

I use pylink-square Python module with pytest to run tests on almost 100 devices at a time and several time a day.
In some conditions I couldn't list easily here, the temporary copy of J-Link library is not deleted at the end of the tests.
(probably because is is done with Library del method?)
Each copy represents about 15MB on disk, this will then represent more than 1 GB after several days or weeks.

@hkpeprah
Copy link
Contributor

Sorry about the late response here. The file should be cleaned up as a part of the __del__ (the destructor) when the class instance is garbage collected. Is it possible that your tests are exiting without allowing the Python garbage collector to run? This workaround was put in place because an early version of the library did not allow for multiple device communication from the same machine at the same time. That has since been patched, so we can probably put a version guard around the copy, but would have to be careful in how we do that; e.g. copy the library first, check the version, if it is high enough, then delete the copy and use the original.

chanqueo pushed a commit to chanqueo/pylink that referenced this issue Apr 17, 2023
This parameter allow preventing temporary copy of J-Link Library.
@chanqueo
Copy link
Contributor Author

chanqueo commented Apr 18, 2023

Hi I propose to let the user decide if he wants this copy or not in PR #172.
By default, this copy is done to keep legacy behavior.
User can disable it by setting use_tmpcpy to False in JLink() and/or Library() constructors.

@hkpeprah
Copy link
Contributor

Will take a look!

chanqueo added a commit to chanqueo/pylink that referenced this issue Apr 23, 2023
This parameter allow preventing temporary copy of J-Link Library.
hkpeprah pushed a commit that referenced this issue May 1, 2023
This patch introduces a parameter to the constructor for the `JLink` instance,
as well as the `Library` instance to prevent the internal behaviour of copying
the library to allow for multiple debuggers to be used at the same time in
earlier versions of the SDK.
@hkpeprah
Copy link
Contributor

hkpeprah commented May 9, 2023

v1.1.0 should have this change in it now; sorry for the delay, and thank you for the patch!

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

2 participants