We have to fight for every free byte.
So i'm wondering, that a simple Location request decreased the memory so much.
function initialize() { }
function compute(info)
{
var h1 = 0.0;
var h2 = 0.0;
// h1 = info.startLocation.toRadians();
// h2 = info.currentLocation.toRadians();
Sys.println( "usedMemory: " + Sys.getSystemStats().usedMemory );
}
function onUpdate(dc) { }
>>> usedMemory: 9825
function initialize() { }
function compute(info)
{
var h1 = 0.0;
var h2 = 0.0;
h1 = info.startLocation.toRadians();
h2 = info.currentLocation.toRadians();
Sys.println( "usedMemory: " + Sys.getSystemStats().usedMemory );
}
function onUpdate(dc) { }
>>> usedMemory: 11083
To get four values (2 x Long/Lat) decrease the memoy about 1258 bytes.
Why?
The memory using without code is around 10kb, the memory limit is around 15kb. So only get start and current Location takes 25% of the available memory.
Other simple code takes much memory too.
As a consequence, developing a bigger DataField for 1 Field Layout, with display serveral data values, is very limited.