xcode中leaks使用
来源:互联网 发布:江苏省软件检测中心 编辑:程序博客网 时间:2024/05/28 03:03
使用xcode开放app的时候,如果环境是非arc环境,或者使用到了c++进行混编。需要考虑到内存的管理。在此记录xcode中的工具使用,方便日后查看吧。
1,新建一个项目,添加一个按钮,制造一个内存泄露,方便测试使用。
- (IBAction)addbutton:(id)sender { NSString *str = [[NSString alloc] initWithFormat:@"%ld, %ld," , 100L, -1L]; UIAlertView *alerView = [[UIAlertView alloc] initWithTitle:str message:@"message" delegate:nil cancelButtonTitle:@"cancel" otherButtonTitles:nil]; [alerView show]; char *str111 = (char*)malloc(100); str111[10] = '\n'; printf("%s", str111); //free(str111);}
2.点击,选择模拟器运行。打开xcode中instruments工具,选择leaks。
3.在选择我们需要测试程序,此处的程序background.
4.选择运行。
5.触发内存泄露,下图红色即为内存泄露。
6.双击,看到内存泄露列表,双击列表一项,就会定位到具体代码。
0 0
- xcode中leaks使用
- 怎样在xcode中使用memory Leaks 和Instruments
- 在XCode中使用memory Leaks和Instruments
- 在xcode中使用memory Leaks和Instruments
- Instruments 中 Leaks使用
- 怎样在xcode里面使用Memory Leaks和Instruments教程
- 怎样在xcode里面使用Memory Leaks和Instruments教程
- 怎样在xcode里面使用Memory Leaks和Instruments教程
- 怎样在xcode里面使用Memory Leaks和Instruments教程
- 怎样在xcode里面使用Memory Leaks和Instruments教程
- 怎样在xcode里面使用Memory Leaks和Instruments教程
- 怎样在xcode里面使用Memory Leaks和Instruments教程
- xcode里面使用Memory Leaks和Instruments检测内存泄漏
- 怎样在xcode里面使用Memory Leaks和Instruments教程
- 怎样在xcode里面使用Memory Leaks和Instruments教程
- 怎样在xcode里面使用Memory Leaks和Instruments教程
- Xcode使用Profile的leaks检测内存泄露
- Xcode-Instruments-Leaks
- kvm 虚拟机的启动
- Web上的用户登录功能安全
- (浅谈)AndroidStudio中关于多渠道打包相关处理
- Nginx 服务器安装及配置文件详解
- png转jpg背景颜色改变的问题
- xcode中leaks使用
- Win 32同步与异步串口通讯
- JS学习总结 - 数据类型,转换
- 一千行MySQL学习笔记
- UML入门 之 交互图 -- 时序图 协作图详解
- 最近碰到一个oracle“分布式事务处理已经开始”的问题
- SQL Server 0101 首日期的处理
- Cisco路由器ACL安全应用—Local-And-Key
- 多个线程顺序执行的几种方法