Open Danfro opened 5 years ago
@Danfro Thanks for reporting! :+1:
I`ll try and recreate it do you have a type of images it happen the most on?
I am only running ubuntu touch on my phone. No other devices or images I am afraid.
Stupid me ;-). Thinking of system images, not of photo=images. I tried 3 or 4 photos yesterday with the same result.
I tried several resolutions today. With small images I do get the size data more or less without delay - and without crashes. My example image and the other ones I had this issue with yesterday are full quality and highest resolution. The app crashes more or less only if the height and width information can not be extracted. The large the file the longer the delay before height and width values are shown. Even with the large files there where very few occasions when I did get height and width shown and no crash. The app crashing happens most of the time. System freeze only once so far, the log off only very rarely.
So it might be a memory thing depending on the size of the image.
Hmm yeah that sound like either a memory issue or some race condition issue , btw did the unity UI freeze or just the camera app ?
Btw. is there a specific reason why the option image info is not available at the gallery as well?
Most of the time the camera app crashes = the app closes down. Everything else keeps working. Twice the whole UI freezed. I had to press and hold the power button to get my phone responding at all. Twice the screen showed the ubuntu screen with those dots and I had to log in again.
Hmm I`ll try an replicate it on my Meizu PRO
Has this become any better with RC 2018-W50? Ref: https://github.com/ubports/ubuntu-touch/issues/965
At some point being out of memory is a hard limit (especially when we only have 1GB), but we can try to make things better.
Hi Dalton, thanks for reminding me on those issues. ;-) I already did some testing and I really wanted to update them (I promise!), just didn't found the time. Until rc 2018-W48/OTA6 I had only 31 MB swap memory. I am sure that was also the reason for #915 . I already tried applying zram before the last update. This resulting in 511 MB of swap memory. Yes it does make it better, but no I can not call it solved. :-( I just did a new test with rc 2018-W50. Reboot phone to make sure I start from scratch. free -h >>Documents/mem.txt does provide the available memory. Photos are highest quality and resolution.
Test one [see mem1.txt]: open terminal app open camera app as well do image info of 1st photo do image info of 2nd photo do image info of 3nd photo terminal app freezes for a few seconds, then asks for password again do image info of 4th photo do image info of 5th photo do image info of 6th photo mem1.txt
Test 2 using only free -h and taking screenshots from terminal app open terminal app (free -h, screenshot) open fluffychat (free -h, screenshot) open camera app as well (free -h, screenshot) do image info of 1st photo (free -h, screenshot) do image info of 2nd photo (free -h, screenshot) camera app crashes!!!
As you can see image info is using a lot of memory. If you open other apps and do not print free -h to a file but take screenshots (so consume more memory) the camera app crashes. Therefore I would like to keep this issue open.
Since this is specific to the camera app (the operation which takes a lot of memory), I've moved this issue there.
@Danfro Thanks for the great info it really helps! It seems that the first instance of querying the image photos take most of the memory and the rest are just incremental changes (Which is a issue by it self as it seems that the high qulaty images doesn't get cleaned once they are off screen...) I`ll try and investigate it now that my meizu is working again...
BTW how did you do the zram trick i want it too :)
@dark-eye it would be great if you could do some further testing with your device.
In rc zram should be activated as default.
Otherwise sudo start zram-touch
should do the job. Have fun! :-)
You will have to do this every time you reboot. It is not persistent on stable channel yet.
Hmm it seems thatthe camera app just doesn't wok on my meizu now :/ I`ll have to investigate the reason for it....
@Danfro I can't seem to reproduce it in Meizu Pro however here is a possible fix for this issue can you test it and check if the memory leak still exists?
@dark-eye Thanks for your efforts to solve that issue. I will have to check the memory usage again. I am just a bit busy with food consumption and family parties at the moment :-), so I am not sure how soon I will have time for tests. I will come back then...
Steps to reproduce
I tried it several times now. It seems to me that extracting the image size does take a few seconds. At that point when the values are taken sometimes it actually extracts/shows height and width correctly :-) or crashes. :-(
Expected behavior
Logfiles and additional information
screenshot showing the zero values photo for testing
![image20181010_181524417](https://user-images.githubusercontent.com/37637312/46762805-6720b880-ccd8-11e8-839e-5602ea04267c.jpg)