内存泄漏在虚拟机的垃圾收集语言运行类型(即的Dalvik) [英] Types of memory leaks in a garbage-collected language running in virtual machines (ie, Dalvik)

查看:149
本文介绍了内存泄漏在虚拟机的垃圾收集语言运行类型(即的Dalvik)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不是有两种类型的内存泄漏的一个垃圾回收的语言打交道时:用户自codeD和运行环境?也就是说,糟糕的用户code(说很多全局静态引用)与在运行时的错误,或者是他们认为在同一个?正在使用的工具来找到它们通常是一样的吗?

Aren't there two types of memory leaks when dealing with a garbage collected language: user-coded and runtime-environment? That is, poor user code (say lots of global static references) vs bugs in the runtime, or are they considered one in the same? Are the tools used to find them the same typically?

推荐答案

据我所知,较差的用户code是领先的内存泄漏的主要问题。而在Dalvik的是,Java堆使用dlmalloc为allocing内存,这可能会导致更多的内存碎片;即使你叫GC,虚拟机可能会无法修整,因为在Linux中存在的基本单元每页4K的Java的堆。所以Android的低RAM页面( http://developer.android.com/training/articles/ memory.html )表明我们能在同一时间更连续的内存分配/免费对象,这看起来像代内存管理由专人(的 http://developer.android.com/training/articles/memory.html#AllocatingRAM )。

As I know, poor user code is the main problem for leading memory leak. And In Dalvik, the java-heap uses dlmalloc for allocing memory, this may lead more Memory fragmentation; even if you call GC, the VM may not trim the java-heap because of 4K per page in Linux being the basic unit. So the android low ram page(http://developer.android.com/training/articles/memory.html) suggests us to alloc/free objects at same time for more continuous memory, and this looks like Generational memory management by hand(http://developer.android.com/training/articles/memory.html#AllocatingRAM).

用户code内存泄漏可以通过MAT工具分析。 <一href=\"http://stackoverflow.com/questions/23473555/trying-to-understand-dalvikvm-and-memory-leaks/23475462?noredirect=1#comment36032209_23475462\">Trying了解Dalvikvm和内存泄漏

User code memory leak can be analysis by MAT tool. Trying to understand Dalvikvm and memory leaks

这篇关于内存泄漏在虚拟机的垃圾收集语言运行类型(即的Dalvik)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆