Shell Version -21328Failed invoking <symbol>

Former Member
Former Member
When i run the simulator i get an out of memmory error . i have attached the program.
Environment: OSX Yosemity, ConnectIQ SDK 1.0.0

$ monkeydo bin/006-B1765-00.prg fr920xt
Found Transport: tcp
Connecting...
Connecting to device...
Device Version 0.32.2Device id 0 name "A garmin device"
Shell Version 205311Copying file.... 10% complete
Copying file.... 20% complete
Copying file.... 31% complete
Copying file.... 41% complete
Copying file.... 52% complete
Copying file.... 62% complete
Copying file.... 73% complete
Copying file.... 83% complete
Copying file.... 94% complete
Copying file.... 100% complete
File pushed successfully
Connection Finished
Closing shell and port
Found Transport: tcp
Connecting...
Connecting to device...
Device Version 0.32.-Device id 0 name "A garmin device"
Shell Version -21328Failed invoking <symbol>
Out Of Memory Error
@PC = 0x10000d88
@PC = 0x10001406
@PC = 0x100000f0
Failed invoking <symbol>
Out Of Memory Error
Out Of Memory Error
Complete
Connection Finished
Closing shell and port
  • I can confirm that this PRG causes an out of memory error in the simulator, but I'll need more information to provide you with any useful suggestions. Can you provide some of the code for the app, or describe what the app is doing? Are you loading any resources (bitmaps, fonts, etc.) with this app?
  • Former Member
    Former Member over 10 years ago
    Thanks. Source code is available here: https://github.com/PerArneng/bigheart

    No bitmaps loaded. Just a simple field. It has worked in the simulator before.
  • Former Member
    Former Member over 10 years ago
    Every line of code you write costs memory in CIQ, even if you don't execute it.
    So even before you start your app you've only got a couple of thousand bytes left.

    Your font takes up more than 3000 bytes. That's because
    a) dictionaries are not memory efficient
    b) every array you use (I think you have 78) takes 24 bytes + 1 extra byte for each value it holds (+4 bytes for each Number value)

    If you put a "System.println(System.getSystemStats().usedMemory);" before and after the initialization of your font and remove the first 4 entries (so you don't run out of memory), you can see it for yourself.

    I think the easiest solution for your problem is to flatten the structure of your font, so that each char only has 1 array. This would mean some minor changes in your draw function, but using modulo that shouldn't be too difficult to do.
  • Former Member
    Former Member over 10 years ago
    Thanks . Ok i see. But people can use images and other resources. Are we talking about stack vs heap here?
  • Everything in MonkeyC is handle/body, so for the most part we're talking about heap.
  • Former Member
    Former Member over 10 years ago
    More out of memory problems

    I got another Out Of Memory error and i have really been trying to minimise allocations. I have just a few allocations but i still cant get the simulator to work.
    I got the code to work with the previous project i hade but with this new one i have no look. Is there a way to profile my app so that i can resolve these issues
    myself?

    Connecting to device...
    Device Version 0.32.1Device id 0 name "A garmin device"
    Shell Version 3.32.1Failed invoking <symbol>
    Out Of Memory Error
    @PC = 0x100003e1
    @PC = 0x10000678
    @PC = 0x10000629
    Out Of Memory Error
    Complete


    Some memory trace info:
    Shell Version 963641ScalableTextDrawer ## used:21303 ## free:0: initialize 1
    ScalableTextDrawer ## used:21928 ## free:0: initialize 2
    VirtualDisplay ## used:22820 ## free:0: initialize
    ScalableTextDrawer ## used:24076 ## free:0: initialize 3


    System.getSystemStats().freeMemory reports 0

    Source code is attached.
    $ sh build.sh

    To build it.
  • Former Member
    Former Member over 10 years ago
    Apparently i was using an older version of the SDK without knowing but works now when its update. Is there however a good way to know how to resolve an out of memory error?