In C:\Android\android-sdk\tools, you'll find Monitor.bat.
If your application does not appear in the list under your device, add this line to your manifest:
SetApplicationAttribute(android:debuggable, "true")
Then click on the first green icon in the icon bar (update heap) and select the heap tab on the right. You can see now all memory allocations in pseudo real-time.
No this is on a unit that runs for days before hitting any issue and it didn't seem to have any error as such in the log. When going into the app manager I saw that the avail memory was down at about 8Mb.
I'm going to try a few things using the pointer that Informatix gave me, hopefully then I can isolate any areas of the software that could be causing this.
It was weird that it didn't throw an error. Sadly one of the issues that could cause it requires manual intervention and can't be automated - barcode scanning.
In the code above, do I need to manually destroy objects to prevent memory leaking, or the garbage collector will take care of them?
B4X:
'Class module
Sub Class_Globals
Type typeDataSet(Rows As List)
Private Dataset As typeDataSet
End Sub
'Initialize
Public Sub Initialize
Dataset.FieldsDescr.Initialize
Dataset.Rows.Initialize
SomeFunction
SomeFunction 'Does this call generates memory leak??
End Sub
Private Sub SomeFunction
Dim i As Long
'Should I iterate through previous rows and destroy??
Dataset.Rows.Initialize
For i = 0 To 9
Dim row(2) As Object
row(0) = i
row(1) = 'test' * i
Dataset.Rows.Add(row)
Next
End Sub