We have met a problem which is probably related to memory leak, but it could also be that our application is getting quite large.
The app is currently running on the Embedded Master module which should have 8 MB of RAM, but the GC reports a total of 5242632 bytes (about 5MB) Where does the remaining 3MB go ?
Will moving all strings (like in the exemple below) to resource file reduce total RAM usage ?
Log.Info("This is a string, but is it taking up RAM or is it stored in Flash ?");
The problem seems to be “SZARRAY” which grows until we break. What kind of data/objects go to type 13 (SZARRAY) ? Need input to help me debug my code…
Why does the allocation fail (Failed allocation for 53 blocks, 636 bytes), we still have more than 636 bytes available…
Does there exists some way to query the GC or other system objects about total memory usage during runtime, and is there a way to debug/show the total objects of each type ?
GC: 638msec 5218320 bytes used, 24312 bytes available <= Giving a total of 5242632 bytes (!?)
Type 0F (STRING ): 110772 bytes
Type 11 (CLASS ): 1451760 bytes
Type 12 (VALUETYPE ): 4632 bytes
Type 13 (SZARRAY ): 2829900 bytes
Type 15 (FREEBLOCK ): 24312 bytes
Type 17 (ASSEMBLY ): 71484 bytes
Type 18 (WEAKCLASS ): 432 bytes
Type 19 (REFLECTION ): 204 bytes
Type 1B (DELEGATE_HEAD ): 7200 bytes
Type 1C (DELEGATELIST_HEAD ): 120 bytes
Type 1D (OBJECT_TO_EVENT ): 696 bytes
Type 1E (BINARY_BLOB_HEAD ): 481728 bytes
Type 1F (THREAD ): 4224 bytes
Type 20 (SUBTHREAD ): 432 bytes
Type 21 (STACK_FRAME ): 4752 bytes
Type 22 (TIMER_HEAD ): 144 bytes
Type 26 (WAIT_FOR_OBJECT_HEAD): 48 bytes
Type 27 (FINALIZER_HEAD ): 242568 bytes
Type 31 (IO_PORT ): 468 bytes
Type 34 (APPDOMAIN_HEAD ): 72 bytes
Type 36 (APPDOMAIN_ASSEMBLY ): 6684 bytes
Failed allocation for 53 blocks, 636 bytes