How can a moderately sized memory allocation fail in a 64 bit process on Mac OS X?

前端 未结 6 1691
眼角桃花
眼角桃花 2021-01-02 01:30

I\'m building a photo book layout application. The application frequently decompresses JPEG images into in-memory bitmap buffers. The size of the images is constrained to 10

6条回答
  •  离开以前
    2021-01-02 02:07

    It could be a memory fragmentation issue. Perhaps there are not any single contiguous chunks of 400 MB available at the time of allocation?

    You could try to allocate these large chunks at the very start of your application's life cycle, before the heap gets a chance to become fragmented by numerous smaller allocations.

提交回复
热议问题