Skip to content

Instantly share code, notes, and snippets.

@rnapier
Created January 17, 2014 01:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rnapier/8466934 to your computer and use it in GitHub Desktop.
Save rnapier/8466934 to your computer and use it in GitHub Desktop.
Testing memory growth, optimized with standard Xcode settings (paste into Command Line app and hit Cmd-I)
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[])
{
@autoreleasepool {
for(NSUInteger i = 0; i < 10000; i++)
{
for(NSUInteger j = 0; j < 10000; j++)
{
NSNumber* n = [NSNumber numberWithUnsignedInteger:j];
NSLog(@"%@", n); //Disabled this to increase memory bloat faster.
}
}
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment