MPA

From the to-do list: MPA V1.0: Older issues and tasks

✔ Memory leak

Comments

Pierre henri Seylan on June 22, 2018:

There is a new memory leak in the MPA.
When running the app for a long time, the memory increase up to 4GB.

This happens without even using the app, so i couldn't find out any cause for the leak by using the app.

Please investigate and fix the issue if possible, also it would be good to know the cause so that we can alert the other developers about this, avoid them to re-introduce the problem...

Karim Alabtakh on June 26, 2018:

I have found two things which cause memory leak/overhead.
1- leak with curl lib releated to incompatibility with last changes in some background threads (chat, invitations, etc). so this one case noticeable leak when running the app for a long time. I have fixed it.

2- Some strange implementaion of blured header background image loader.
it look like that there is misunderstood of pack's images uploading/downloading process.
Thanapong was implemented like this:
1- Implement (dublicate) seperate image loader for header packs image.
2- Download images without resizing (the same images are downloaded by main images manager but with resizing).
3- Blure and save it into memory.

as I understand it was done to improve blured header quality, but it will not work for new packs because we resizing images before upload (this point was discussed before in another memory leak/overhead task).
and actually the resizing images after download was implemented as extra feature to temporary avoid memory overhead and assuming that old packs will be reuploaded.

So, if you really want to improve blured header quality then we shoud discuss that, because maybe additional api should be implemented.

Pierre henri Seylan on June 27, 2018:

Regarding the issue with the blurred image header.
Is this a leak, or rather a feature that requires a lot of memory?
I.E i don't see the app using GB of memory anymore 

Karim Alabtakh on June 27, 2018:

it's feature which not correctly implemented and conflicts with upload/download image process logic.
What is the point of downloading packs images twice?

Karim Alabtakh on June 27, 2018:

also, have you tested this feature with new packs?

Pierre henri Seylan on June 27, 2018:

OK so, i have tested with new packs and the blurred image is in low resolution.

What solution do you reckon for this problem?

What i was suggesting to Tom to implement was to cache only the high-res portion of the image which is used for the blurred header, so not the entire image.
Maybe we could re-implement it using a similar solution, like uploading the resized image of the pack thumbnail, and a small portion of the image in high-res used for the blurred header.

Not sure if that would be suited, let me know what you think would be the best solution.

And yes, the goal is to improve the quality of the blurred header image, since it was displaying a distorted version of the low-res packs image.

Btw, if this is not causing a memory leak, we could close this task and open a new one for this issue.

Karim Alabtakh on June 30, 2018:

Yeh, it's I think that we should upload 2 images, so some API modifications are needed.
yep, it's not memory leak, so you can close it.