Graphic Pool Memory allocation failing despite memory showing ok in sim

Hi,

I'm making my first watch face (a learning process where I'm going to make mistakes) and have been using a Vivoactive 5 as a device. It works fine in the sim and on the device itself so I've begun to test the sim with other devices.

I'm relying quite heavily on bufferedBitmaps to draw on to as a canvas (as I'm also relying on some AffineTransform techniques) and I'm getting the error:

Exception: The requested memory could not be allocated from the graphics memory pool

on most of the other devices at startup.

Thinking it was to do with the size of the bitmap I'm working with, I checked and it's only usng 25kb/125kb on the Vivo, maxing out at 26kb. Which makes me think the issue lays somewhere else I haven't thought of. Also, I would have thought devices that are failing with the graphic pool memory (Forerunner 265, Forerunner 965, Venu 3, Marq Gen 2) would have better hardware than the Vivoactive 5.

I could provode code but I thought I would check first if I'm not missing something obvious, given I'm getting graphic pool memory warnings despite the max not showing it being anywhere near the capacity (unless graphic pool memory is not represented in the max memory stat of the sim. I'm aware that graphic pool and system memory are not the same, but I'm not sure if they overlap when showing usage).

  • I should add that I'm seeing peak memory of about 26kb on the device sim for those that are failing. They only load for a split second so I'm unsure of whether the peak memory stat can be accurate.

  • What you see for peak memory doesn't include what your app uses in the graphics pool.  On a real device, it's a pool and shared by all all apps and not just for your app.

    You want to reduce your bitmaps. custom fonts, etc until you don't get the error, but you may still get it on a real device.

  • Thanks Jim, that's very helpful to know in terms of understanding why I was seeing the error when peak usage wasn't that high.

    Some follow up thoughts if you or anyone else has any experience in these matters:


    1/ Is there a way I can log or view how much memory I'm taking from the graphic pool against what the device has a that time? Whether it be in the simulator or via a log print.

    2/ Am I underestimating the hardware of the Vivoactive 5 vs the Forerunner 265 and 95? I would have thought they could handle beyond what the Vivoactive could handle. If I give them the screen width and height dimensions of the va5 (390), for the bufferedBitmap, they can run the watch face, but cannot at their own native resolutions. I would have thought they had more horsepower to handle their larger screens.

    3/ In terms of graphics, am I better to focus on colorDepth reduction or pallette, or both, when trying to save space? I need to use tint on one of the graphics and this seems to complain if I reduce the colorDepth (though I haven't fully exhausted all options, I'm still learning).