What is REAL limit of objects ???

Former Member
Former Member
Do I miss something?

I got couple of reports that my widget stop to work with IQ! error. When I got log - error was 'Too many objects'.
Did carefully test (that was fenix 3HR) - numer of objects was never above 240, while - according to device xml file - maximum number of objects is 512.

When made changes to ensure that there is no more than 255 objects - error dissapeared.

Is XML file wrong?
What is real number of objects and can it be fixed in XML?

Thanks
  • If you look at peak objects in the view memory selection in the sim, that's real the real number.

    Is your app doing comm, where things you expect to be numbers are coming through as longs? Do you have large arrays of data you might not fully use in the sim, but do on the watch?

    Arrays can be tricky (avoid multi-dimensional ones on 1.x devices), and look at if you are storing simple (like a Number) objects or complex (like a long) objects .
  • Former Member
    Former Member
    I’m referring to peak number of objects only. No longs is in use. There are arrays – but my assumption is that they are counted by peak number?
    I don't see any differences between SIM run and real run, unless JSON is doing something extraordinary, and there objects are not counted?

    So I’m back to same question – is the limit really 512 - as in XML - or 255? Or maybe some of objects coul not be counted by sim?
  • I've always found the numbers in the sim to be correct. Are you using 2.3.4 or the 2.4.0 beta?
    How are you doing as far as peak memory?

    What are you storing in the arrays you use?

    Could you post a code snip of that part?
  • I don't have access to an f3hr, but as a quick test, I added a bit of code to one on my apps so that I was using 325 objects, and it runs fine on the CIQ 1.x devices I do have.

    When you say that your app uses 240 in the sim, even some of my largest/most complex apps use a bit over 100 (peak). A good place to start may be looking at why you are up to 240 in the sim.

    Again, does you app do things like makeWebRequest? There are cases where Numbers come through as longs, and that can burn a bunch of objects.
  • Former Member
    Former Member
    Thanks for looking into my problem.
    Indeed - I'm using makeWebRequest - do you think - it is not measured by Peak objects count?

    I have already removed part of the code, ensuring through use of SIM that peak is never above 255 - sent to the user test version - and got confirmation that now program is working. I have CIQ 1.x device as well - but this is epix - and it has plenty of memory, no issues there.

    My question is NOT what to do to limit number of objects - as this is stright forward - BUT -
    - is the limit in XML a valid one?
    - is SIM measuring correctly peak number of objects (e.g. - generated by makeWebRequest)?

    Above is what I worry about. I know already quite well that MEMORY is the primary issue in CIQ...

    Thanks again for looking into that!

  • With makeWebRequest there have been problems that differ based on GCM/iOS and GCM/Android, where at times, a "Number" is a "Long" in the data. A number is a simple object, while a long isn't.

    So if you get 20 "numbers" there's no increase in objects, but if they come through as longs, that's 20 extra objects (just a simple example). This is something you won't see in the sim, as it's not using GCM.

    Here's something from the bug report forum that talks about this exact problem. It's why I asked about comm and doing makeWebResquests..

    https://forums.garmin.com/forum/deve...27#post1267327
  • Former Member
    Former Member
    That makes sense...
    Thanks Jim!, I'd guess - these objects from makeWebRequests are probably not counted correctly.

    The pity is, there is no API for returning number of objects, only for free memory (or there is a way?) - that would be extremly usefull in tracking down such errors.
  • No they are counted correctly, it's just that if numbers come through as longs it uses many more objects. Like I said, something you won't see in the sim.

    If the data you get back from the makeWebRequest has 50 "numbers" in it, but they come in as longs, that will take 50 more objects. They should come in as numbers, but the post in the bug reports I linked to is an example where they don't.

    What version of GCM does your user use when the number of objects is exceeded? The "fix" is likely in GCM, and not CIQ or your app.