利用离子ZIP压缩时失败 [英] Compression fails when using ionic zip

查看:338
本文介绍了利用离子ZIP压缩时失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是最新版本的离子压缩版本1.9.1.8.I的设置离子拉链的财产 ParallelDeflateThreshold = 0 。该压缩和解机制完美的工作在过去的两年months.Suddenly此停止working.The荏苒线程只是挂,离子拉链刚刚创建的tmp文件并未能创建zip文件。我可以很容易地重现此问题,即使有小的文件大小。

I am using the latest version of ionic zip version 1.9.1.8.I have set the property of ionic zip ParallelDeflateThreshold = 0. The zipping mechanism was working perfectly for the past two months.Suddenly this stopped working.The zipping thread just hangs,ionic zip just created the tmp file and failed to create the zip file. I could easily reproduce this issue even with small file size.

我对这个问题的分析如下:

My analysis for this issue is as follows

问题是用离子拉链的最新版本,在这种情况下,在创建的zip文件的离子拉链忌用。我们注意到,谁使用这个DLL一对夫妇的其他用户也报告了在他们的网站上这样的错误。详情请参阅 。这个问题的链接将通过禁用 ParallelThreshold 离子拉链的属性,但将推迟大的日志文件的性能,因为它可以在单个线程,而不是多线程模式。

The issue was with the latest version of ionic zip, in this case the ionic zip hanged while creating the zip files. We noticed that, a couple of other users who uses this dll has also reported such errors in their site. Please refer the link.This issue will be solved by disabling ParallelThreshold property of ionic zip, but it will delay the performance for large log files, since it works on single thread instead of multithreaded mode.

这个问题是目前解决了设置 ParallelDeflateThreshold 属性默认value.But我找不到这个issue.Why的确切原因并不在压缩和解失败突然?有没有机变。

The issue was solved now by setting ParallelDeflateThreshold property to default value.But I couldn't find the exact cause of this issue.Why does the zipping fail suddenly? There was no machine change.

推荐答案

我正面临着类似的问题,用了不到20-25MB较小的zip文件,它是服用3-4秒,但什么比这更大,它正在采取无限长的时间。代码永远不会执行结束。

I was facing a similar issue, with smaller zip files less than 20-25MB, it was taking 3-4 seconds, but anything larger than that, it was taking infinite time. Code never finished execution.

我开始担心,也许这是错误的决定,毕竟使用DotNetZip库,就像我们zipfiles工作高达500MB。

I started to worry that maybe it was the wrong decision to use DotNetZip library afterall, as we work with zipfiles upto 500MB.

其中的zip文件保存前行,我说: zip.ParallelDeflateThreshold = -1;

Before the line where zip file is saved, I added: zip.ParallelDeflateThreshold = -1;

这可以确保永远不会创建单独的线程。貌似一旦zip文件去通过一定的阈值,DotNetZip保持创建多个线程导致获得最终的zip文件非常大的延迟。

This makes sure that separate threads are never created. Looks like once the zip files goes past a certain threshold, DotNetZip keeps creating numerous threads causing a very large latency in obtaining the final zip file.

这篇关于利用离子ZIP压缩时失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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