I would like to find out whether my Spiderbasic application is using too much memory.
To do this, I first need to know how much RAM my device has and how much RAM I use.
Is there a way to measure this with Spiderbasic (Javascript)?
Measure RAM
Re: Measure RAM
I have found this. Maybe it is useful. However, it does not work with Firefox.
Further informations: https://developer.mozilla.org/en-US/doc ... nce/memory
Code: Select all
Structure sMemoryInfo
jsHeapSizeLimit.i
totalJSHeapSize.i
usedJSHeapSize.i
EndStructure
Global MemoryInfo.sMemoryInfo
Procedure GetMemoryInfo()
! if (!window.performance.memory) return; // doesn't work with Firefox
! var memoryinfo = window.performance.memory;
! g_memoryinfo._jsHeapSizeLimit = memoryinfo.jsHeapSizeLimit;
! g_memoryinfo._totalJSHeapSize = memoryinfo.totalJSHeapSize;
! g_memoryinfo._usedJSHeapSize= memoryinfo.usedJSHeapSize;
EndProcedure
GetMemoryInfo()
Debug "jsHeapSizeLimit: " + MemoryInfo\jsHeapSizeLimit
Debug "totalJSHeapSize: " + MemoryInfo\totalJSHeapSize
Debug "usedJSHeapSize: " + MemoryInfo\usedJSHeapSize