Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

Test: heavy memory leak in iOS test app #104

Open
orangemocha opened this issue Jan 31, 2017 · 2 comments
Open

Test: heavy memory leak in iOS test app #104

orangemocha opened this issue Jan 31, 2017 · 2 comments
Assignees

Comments

@orangemocha
Copy link

orangemocha commented Jan 31, 2017

This could be due to the way we restart instances in JXcore, or could be due to the test app itself. In any case, it should be investigated before we release the restartable instance feature.

When running the iOS test app, used memory keeps growing unbounded. In a regular run, it goes from ~40MB at the beginning to ~1.3GB at the end. With a debug build, it goes up to ~2.85GB, which leads to out-of-memory errors on 32-bit devices.

I wanted to verify if the leaks were due to some functionality exercised by the tests, so I modified the app to run an empty test in a loop 10k times. The results show that this is enough to cause the leak.

After 2k iterations:

image

Memory is never recovered until we go to out-of-memory. This means that it's not a lazy-gc issue, it's an actual leak.

@enricogior enricogior self-assigned this Jan 31, 2017
@enricogior enricogior changed the title Heavy memory leak in iOS test app test: heavy memory leak in iOS test app Jan 31, 2017
@enricogior enricogior changed the title test: heavy memory leak in iOS test app Test: heavy memory leak in iOS test app Jan 31, 2017
@enricogior
Copy link
Member

enricogior commented Feb 16, 2017

memoryleaks

There are several memory leaks, it doesn't look like they are caused by the test app. They may be related to the restart-able thread feature, but we need more investigation to be sure.

@enricogior
Copy link
Member

We tried to isolate the larger memory leaks reducing the tests executed, but that in turn changed the way memory got allocated for each test by the javascript engine. We suspect that starting and stopping the sub-engine doesn't fully reset the memory allocation, therefore a memory leaked after been allocated in a specific test, will not necessary be allocated during that test if the previous tests are not executed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants