Hello to All,
I have an ACER Smartdisplay 24”!
in B4A I wrote an app with:
Webcam-Slideshow (Picasso-Lib - LoadintoBitmap)
Wheather Forecast in a Webview
Download Stockquote and parsing them
Webradio
CCTV-Wifi-Webcam (with Picasso-Lib - Target1) on UDP-Event from a PIR-Sensor connected to an Arduino/Ethernetshield
Monitoring temperature (Inside, Outside and Heating/Warmwater)
Monitoring electric meter
RF433-Remote-Socket (USB to Arduino mit RF-433 Transmitter)
HTTP-Server (Private Homepage with Montitoring-Data)
FTP object for load config-files and logging
UDP-Socket (Push/Pull Data from Arduino / Smartphone)
My problem – the app crashes after 1 or 2 days….. first i add to all subs a "Try-Catch".... crash again
So i add a Sub GetFreeMem:
Now i see.... my Memory shrinks:
Minutes after Start: 20150212-110137: GetFreemMem MB: 384
6 hours later: 20150212-173045: GetFreemMem MB: 296
The GC do not change so much:
From: GC_CONCURRENT freed 397K, 33% free 3027K/4468K, paused 3ms+2ms, total 32ms
TO: GC_CONCURRENT freed 384K, 33% free 3027K/4468K, paused 2ms+1ms, total 24ms
Can this be a/the Problem?
Thx Tom
PS1: I use only 4 Bitmap - with max 1920x1080 (after use -> = null)
PS2: The Code is about 120 kb with some IP/Password inside... so i do not want to post the code completly in the forum
I have an ACER Smartdisplay 24”!
in B4A I wrote an app with:
Webcam-Slideshow (Picasso-Lib - LoadintoBitmap)
Wheather Forecast in a Webview
Download Stockquote and parsing them
Webradio
CCTV-Wifi-Webcam (with Picasso-Lib - Target1) on UDP-Event from a PIR-Sensor connected to an Arduino/Ethernetshield
Monitoring temperature (Inside, Outside and Heating/Warmwater)
Monitoring electric meter
RF433-Remote-Socket (USB to Arduino mit RF-433 Transmitter)
HTTP-Server (Private Homepage with Montitoring-Data)
FTP object for load config-files and logging
UDP-Socket (Push/Pull Data from Arduino / Smartphone)
My problem – the app crashes after 1 or 2 days….. first i add to all subs a "Try-Catch".... crash again
So i add a Sub GetFreeMem:
B4X:
Sub GetFreeMem As Int
Dim r As Reflector
Dim MM, TM, FM, Total As Int
r.Target = r.RunStaticMethod("java.lang.Runtime", "getRuntime", Null, Null)
MM = r.RunMethod("maxMemory")
FM = r.RunMethod("freeMemory")
TM = r.RunMethod("totalMemory")
Total = MM + FM - TM - r.RunStaticMethod("android.os.Debug", "getNativeHeapAllocatedSize", Null, Null)
Return Total / 1024000
End Sub
Now i see.... my Memory shrinks:
Minutes after Start: 20150212-110137: GetFreemMem MB: 384
6 hours later: 20150212-173045: GetFreemMem MB: 296
The GC do not change so much:
From: GC_CONCURRENT freed 397K, 33% free 3027K/4468K, paused 3ms+2ms, total 32ms
TO: GC_CONCURRENT freed 384K, 33% free 3027K/4468K, paused 2ms+1ms, total 24ms
Can this be a/the Problem?
Thx Tom
PS1: I use only 4 Bitmap - with max 1920x1080 (after use -> = null)
PS2: The Code is about 120 kb with some IP/Password inside... so i do not want to post the code completly in the forum
Last edited: