Why memory used increase and appli stops

Monkey Targets Forums/Android/Why memory used increase and appli stops

hub(Posted 2015) [#1]
Hi !
This program display some images as an slideshow. Mojo2 on android target, v85a. The slideshow should be displayed during 24 hours.

On my MK808 android dongle, why the 'used memory increase 40% to 85% and more ... ?

Images width x height : 1000x700 px

I only display an image. using the same 'MonImage' ! And finaly the appli stops ? Memory should be stay at 45% !


Please not that i don't want preload image inside the oncreate(). This is a sample program to understand .My slideshow appli is more complex. In my appli, i've the same problem. When the memory goes to 95% it stop without error message.

If i comment the 'image discard line'. The memory continue to increase.

i use the android appli 'Quick System info pro' to display the used memory. Perhaps you could give me the name of an other to test.



MK808B Plus Technical specifications

CPU: Amlogic M805 Quad-Core 1.5G (Cortex-A5)
GPU: Quad-Core Mali-450 GPU
System Memory: 1 GB DDR3
Storage: 8 GB NAND flash and a micro SD slot supporting up to 32GB
Connectivity: 802.11 b/g/n Wi-Fi (Internal Antenna) and Bluetooth 4.0.
Video & Audio Output: mini HDMI 1.4b
USB: 1x USB 2.0 host port, 1x mini USB OTG port, 1x mini USB for power
Power Supply: 2A 5V Power Supply

Many thanks for your help.


hub(Posted 2015) [#2]
Someone else could try this short code on an android system and test if the used ram decrease ? I finished my appli, i've just this bug. So after one hour, my appli stops without error message. Many thanks. Perhaps with 2Gb ram it works without problem ?
Many thanks for your help and ideas !


MikeHart(Posted 2015) [#3]
Are you discarding the current image before you load a new one? Try that.

Edit: Ok, I see you do that.


hub(Posted 2015) [#4]
It's difficult for me to understand what's wrong.
As i don't really know android, my new Mk808b plus (http://hometheatrelife.com/mk808b-plus-review/), and Monkey (mojo2).
i'm very happy to have finished my project but i've this bug.

- When i've started the project. The images was loaded into the OnCreate() method. But i was limited with 15 images. For for a slideshow, this was not the best idea !
- For each slideshow screen load the image before display and next release it seems to be a better approach ! Today i display 130 images. As i've only 1 Go Ram. The ram memory decrease and at the 130 images, no message, return to the android main screen. I suppose that the system stop the appli when the memory is very low. This was confirmed when i use an appli to measure the used ram.
- So for me the images not really free ? if i use discard(), the used ram memory increase more quickly !
- i've played with the gc options at the program start (see them into the example code). But i'm not a garbage collector guru so today i don't know how to set it in my case.

- So today i don't know what to do. Why the used memory increase ? MK808 too limited with 1Go memory ? Monkey mojo2 bug with release an image ?
Please help !


hub(Posted 2015) [#5]

All will be perfect without this bug.

i'me caregiver, this is a slideshow for old person. I can interact with the system with the wireless keyboard. I use ini files to update texts. i use a usb key to transfert the images into the folder. I can display an message to the screen directly with the keyboard. You can see a memory measure at the top right of the screen with another appli. Images are displayed as 'diaporama'. A diaporama could be lauched only a day, at a specific hour. There are also some vocals messages to give the hour for example.


Mk808b plus connected to the tv, android 4.4.


hub(Posted 2015) [#6]
The same code, now with mojo1 : memory used is now stable here ! So it should be a problem only with mojo2 ? (i can't pass to mojo1 as the project use the mojo2 font code !!!).




hub(Posted 2015) [#7]
so :
- Perhaps it's easy to convert mojo2 font -> mojo 1
- Perhaps this is a bug with mojo2 and Mark could be correct it (i'm not an expert here !).
- my hardware mk808 is too limited with mojo2.


hub(Posted 2015) [#8]
i'm back to mojo1 without appli crash.


hub(Posted 2015) [#9]
Many thanks to the monkey community.


therevills(Posted 2015) [#10]
If you think its a Mojo2 issue raise a bug report in Bug Reports forum:

http://www.monkey-x.com/Community/topics.php?forum=201


Pierrou(Posted 2015) [#11]
The code itself is simple and looks OK, hard to see what's wrong with it...? Anyway Mojo2 is not needed here.


hub(Posted 2015) [#12]
All my project works fine now with mojo1, I'm very happy with this ! Sad days before as i was affraid with a possibility to be stopped by mine design fault . I've adapted the mojo 2 font class to mojo1. It's true that mojo2 not needed for this project. Developp for android is more difficult than Blitzmax and Windows !

@Pierrou Merci Pierrou pour ton message.


therevills(Posted 2015) [#13]
Anyway Mojo2 is not needed here.


That's not the point, if hub has found a bug with Mojo2 it should be reported.


MikeHart(Posted 2015) [#14]
Many thanks to the monkey community.


Being sarcastic and upset here?


Pierrou(Posted 2015) [#15]
@mike I don't think so, Hub got a lot of help from various people in other threads. Indeed we are lucky to have all those talented and helpful coders around.
@therevills of course it should!


hub(Posted 2015) [#16]
@ MikeHart :I'm just happy to have all this help. It's a great community. There are tons of codes samples and examples. I've read a lot of forum threads. Tatented coders be sure, are here..
@therevills : it could be an hardware 'mk808b plus' limitation too. I'm not very sure about a bug.