dcty

 for (int i = 0; i<10000000; i++) 

    {

        NSString *string = @"Abc";

        //        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

        string = [string lowercaseString];

        string = [string stringByAppendingString:@"ABC"];

        //        [pool release];

    }

 

无论是你后台开启了多少应用,只需要这段代码一跑,最终结果就是所有的程序都crash.然后内存就释放出来了.

这个显然和AppStore上的内存释放软件原理不同哈,这个就是暴力.

这样的做法和iOS的机制是有关的,具体的自行搜素.

分类:

技术点:

相关文章:

  • 2021-12-05
  • 2021-12-06
  • 2021-11-18
  • 2021-12-05
  • 2021-08-31
  • 2021-11-17
  • 2021-12-10
  • 2021-04-25
猜你喜欢
  • 2021-11-07
  • 2021-11-14
  • 2021-09-30
  • 2021-12-06
  • 2021-10-19
  • 2021-10-19
  • 2021-11-21
相关资源
相似解决方案