`
mryufeng
  • 浏览: 968475 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

R13B03 binary vheap有助减少binary内存压力

阅读更多
R13B03 binary vheap有助减少binary内存压力.

参看:http://www.erlang.org/download/otp_src_R13B03.readme

引用
    OTP-8202  A new garbage collecting strategy for binaries which is more
      aggressive than the previous implementation. Binaries now has
      a virtual binary heap tied to each process. When binaries are
      created or received to a process it will check if the heap
      limit has been reached and if a reclaim should be done. This
      imitates the behavior of ordinary Erlang terms. The virtual
      heaps are grown and shrunk like ordinary heaps. This will
      lessen the memory footprint of binaries in a system.


原来的binary和其他类型的eterm是混在一起的,当进程的heap用完的时候,才进行GC,腾出空间。现在是把binary单独抽取出来,单独计数, 当binary用量过大的时候,马上就GC。

这个策略对于我们的服务器程序很有帮助,因为我们的服务器程序基本上包都是binary, 很容易出现binary无法及时回收,导致内存耗光的情况。

具体的改进效果待进一步的观察。

Note: 具体效果参考这个 http://www.lshift.net/blog/2009/12/01/garbage-collection-in-erlang

效果还是非常理想,谢谢cryolite
分享到:
评论
1 楼 mryufeng 2009-11-30  
NIF的binary也使用类似vheap的概念,还有EEP31 binary库的出现。总之现在是把binary的使用,提高到新的层次。

相关推荐

Global site tag (gtag.js) - Google Analytics