Jmap:可以获得运行中的jvm的堆的快照,从而可以离线分析堆,以检查内存泄漏,检查一些严重影响性能的大对象的创建,检查系统中什么对象最多,各种对象所占内存的大小等等 Jmap是一个可以输出所有内存中对象的工具,甚至可以将VM 中的heap,以二进制输出成文本。打印出某个java进程(使用pid)内 ...
分类:
编程语言 时间:
2018-03-21 15:03:05
阅读次数:
223
无 论怎么小心,想完全避免bad code是不可能的,此时就需要一些工具来帮助我们检查代码中是否存在会造成内存泄漏的地方。 Android tools中的DDMS就带有一个很不错的内存监测工具Heap(这里我使用eclipse的ADT插件,并以真机为例,在模拟器中的情 况类似)。用Heap监测应用进 ...
分类:
移动开发 时间:
2018-03-21 11:27:48
阅读次数:
170
1 #include <stdio.h> 2 #include <stdlib.h> 3 #include "heap.h" 4 5 Heap Heap_Create(int Capa) 6 { 7 if(Capa < HEAP_DEFAULT_CAPACITY) { 8 Capa = HEAP_D ...
分类:
其他好文 时间:
2018-03-19 22:42:25
阅读次数:
231
今天主要介绍一下我使用MAT工具分析文件时遇到的一个错误 Error opening heap dump 'a.hprof'. Check the error log for further details.Error opening heap dump 'a.hprof'. Check the e ...
分类:
移动开发 时间:
2018-03-19 18:11:51
阅读次数:
210
go tool pprof --text http://localhost:7777/debug/pprof/heap go tool pprof --text http://localhost:7777/debug/pprof/profile ...
分类:
其他好文 时间:
2018-03-19 13:39:40
阅读次数:
95
Stack属于栈的区域,属于每条线程私有的。 方法区和本地方法栈有很大的不同,方法区是用Java级别角度做的代码,本地方法栈指向的是C/C++。 Java开发,对象就在堆中,一般而言,堆中只有对象。 栈溢出测试: 常量区溢出报错测试: DirectMemory溢出报错测试: ...
分类:
其他好文 时间:
2018-03-18 23:20:52
阅读次数:
223
如果想了解堆的概念,可以点击此处查看前面关于堆的定义的随笔。 堆的操作接口包括初始化堆、销毁堆、向堆中插入元素、从堆顶移除元素、堆的结点个数。 我们用heap来命名一个堆。下面是对以上接口的定义: heap_init void heap_init(Heap *heap,int (*compare)( ...
分类:
其他好文 时间:
2018-03-18 10:27:07
阅读次数:
216
NIO中的heap Buffer和direct Buffer区别 ...
分类:
其他好文 时间:
2018-03-17 17:55:04
阅读次数:
256
Your database is in NOARCHIVELOG mode and a logswitch happens every 20 minutes. On Thursday morning, media failure resulted in corruption of a data fi ...
分类:
其他好文 时间:
2018-03-16 19:35:55
阅读次数:
161
二分一下,然后从左到右扫描,扫到左端点就把区间 push 到堆里。 每次有点不符合二分的值时,就贪心地选择右端点最远的 add。 ...
分类:
其他好文 时间:
2018-03-16 17:21:42
阅读次数:
159