-
-
Notifications
You must be signed in to change notification settings - Fork 135
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
memory leak java <-> javascript when java returns []array #1363
Comments
@vtrifonov can you also have a looks at this one? its a huge issue for us. We have bluetooth connected to a few devices that send many events |
@patricklx what tool did you use to take and compare the memory snapshots? |
@vtrifonov I used the chrome devtools memory snapshots |
We found a problem when creating Array Wrappers which seems to leak memory because of the ObjectTemplates being created every time. However arrays need more memory than a string as we attach some callbacks to them so that they can work in the JS. |
thanks. we tried out the latest snapshot, and memory usage is quite stable! |
Could you please try to delete platforms folder and try to build it again. If you could reproduce the problem could please open a new issue with some steps to reproduce it(e.g. files missing) so we could be able to fix it. |
Environment
Provide version numbers for the following components (information can be retrieved by running
tns info
in your project folder or by inspecting thepackage.json
of the project):Describe the bug
We observe a memory leak when we have the following call thread:
this was to reproduce the ble pattern, but I tested again and I see the leak with only getValue. Looks like it only happens when
byte[]
is returned. Same issue when String[] is returned.https://github.com/patricklx/ns-memory-leak/blob/master/app/App_Resources/Android/src/main/java/my/Test.java#L25
I did few memory snapshots, and what is beeing left over is a lot of
system / FunctionTemplateInfo
andsystem / ObjectTemplateInfo
NOTE:
we do not have a memory leak if the getValue does not return the value
markingMode: none, does not help either.
Expected behavior
GC should collect the java array
Sample project
https://github.com/patricklx/ns-memory-leak
this can also be observed with the ble plugin,
since its the same pattern:
https://github.com/EddyVerbruggen/nativescript-bluetooth/blob/master/src/android/TNS_BluetoothGattCallback.ts#L212
The text was updated successfully, but these errors were encountered: