iPhone OS Memory Warnings. What Do The Different Levels Mean?

Memory level warnings are logged by SpringBoard. As an app developer you don’t need to care about it. Just responding to -{application}didReceiveMemoryWarning is enough. There are 4 levels of warnings (0 to 3). These are set from the kernel memory watcher, and can be obtained by the not-so-public function OSMemoryNotificationCurrentLevel(). typedef enum { OSMemoryNotificationLevelAny = … Read more

bds 2006 C hidden memory manager conflicts (class new / delete[] vs. AnsiString)

After extensive debugging i finely isolated the problem. Memory management of bds2006 Turbo C++ became corrupt after you try to call any delete for already deleted pointer. for example: BYTE *dat=new BYTE[10],*tmp=dat; delete[] dat; delete[] tmp; After this is memory management not reliable. (‘new’ can allocate already allocated space) Of course deletion of the same … Read more

What are the differences between virtual memory and physical memory?

Softwares run on the OS on a very simple premise – they require memory. The device OS provides it in the form of RAM. The amount of memory required may vary – some softwares need huge memory, some require paltry memory. Most (if not all) users run multiple applications on the OS simultaneously, and given … Read more

Is it necessary to use autoreleasepool in a Swift program?

The autoreleasepool pattern is used in Swift when returning autorelease objects (created by either your Objective-C code or using Cocoa classes). The autorelease pattern in Swift functions much like it does in Objective-C. For example, consider this Swift rendition of your method (instantiating NSImage/UIImage objects): func useManyImages() { let filename = pathForResourceInBundle for _ in … Read more