2008 November 14th Friday (十一月 十四日 金曜日)

本文描述了在使用LZMASDK for Java过程中遇到的一个内存溢出错误,并详细记录了调试过程及解决方案。作者发现压缩字典初始化大小设置过大导致Java虚拟机无法分配足够的内存空间,通过调整该值成功解决了问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

   I found out a bug in the LZMA SDK for Java.  I don't know whether the author test it.  When I run it after compiled it, Java VM tell me an exception on
out of memory.  I felt so strange.  How much memory a compression tool needs?  After debuging, I found out there is a variable _dictionarySize is initialize
with a so big number -- 2 ^ 22.  My god!  That is why Java can not initialize an integer array with it.

  I cut half of that down.  OK.  The program can run correctly.  I tried making a compression archive, and restored it correctly.

  I can read the source of the LZMA in Java.  By the way, the algorithm implemented in C++ is so hard to read.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值