views:

476

answers:

1

I am trying to free up some unused resources in my app. I have a couple MBs of an (object?) of category GeneralBlock and I have no clue what this is or how I should be approaching the freeing up of this GeneralBlock.

GeneralBlock has no apparent use. When I start my app there is a MENU screen at which point in time I have about 300kb of memory being used. At the end of the app, the user presses a button that brings him/her back to that same MENU screen, where there should STILL be only about 300kb of memory being used, but instead there is almost 2.5MB of memory!!!??? Most of it is attributed to GeneralBlock, hanging around somewhere. I have my display setting set to "Objects Created and Still Living" so it can't be any dealloc'd objects...Please enlighten me.

+1  A: 

From Tracking Memory Usage:

In icon mode, the ObjectAlloc instrument displays a table with a listing of all memory blocks ever allocated in the application, as shown in Figure 1. The Category column shows the type of the memory block—either an Objective-C class name or a Core Foundation object name. If ObjectAlloc cannot deduce type information for the block, it uses “GeneralBlock-” followed by the size of the block (in bytes). The Net column shows the number of blocks of each type currently present in the application’s memory heap. The Overall column shows the total number of blocks of each type that were allocated, including blocks that have since been released.

Also see this post.

Basically, as long as nothing is leaking, those GeneralBlock allocations are fine.

Shaggy Frog
So....GeneralBlock allocations are harmless then? Even if they seemingly keep on increasing in the graph?
RexOnRoids
Well, GeneralBlock allocations are from libraries outside what ObjectAlloc knows about. As Tim says at http://stackoverflow.com/questions/1061235/checking-memory-allocation-in-instruments, those will not decrease (I've never seen it decrease for my apps, at least).
Shaggy Frog