commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Work logged] (COMPRESS-481) Allow passing memory limit for extraction to SevenZFile
Date Tue, 16 Apr 2019 10:42:00 GMT


ASF GitHub Bot logged work on COMPRESS-481:

                Author: ASF GitHub Bot
            Created on: 16/Apr/19 10:41
            Start Date: 16/Apr/19 10:41
    Worklog Time Spent: 10m 
      Work Description: bodewig commented on pull request #76: COMPRESS-481 Allow passing
memory limit to SevenZFile

 File path: src/main/java/org/apache/commons/compress/archivers/sevenz/
 @@ -34,11 +35,13 @@
     InputStream decode(final String archiveName, final InputStream in, final long uncompressedLength,
-            final Coder coder, final byte[] password) throws IOException {
+            final Coder coder, final byte[] password, int maxMemoryLimitInKb) throws IOException
         final byte propsByte =[0];
         final int dictSize = getDictionarySize(coder);
         if (dictSize > LZMAInputStream.DICT_SIZE_MAX) {
             throw new IOException("Dictionary larger than 4GiB maximum size used in " + archiveName);
+        } else if ((dictSize / 1024) > maxMemoryLimitInKb) {
 Review comment:
   I think you should call `LZMAInputStream.getMemoryUsage` rather than evaluate the dictionary
size only. Too bad the constructor we use doesn't support the `memoryLimit` parameter other
constructors allow.
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

Issue Time Tracking

    Worklog Id:     (was: 228293)
    Time Spent: 50m  (was: 40m)

> Allow passing memory limit for extraction to SevenZFile
> -------------------------------------------------------
>                 Key: COMPRESS-481
>                 URL:
>             Project: Commons Compress
>          Issue Type: Improvement
>    Affects Versions: 1.18
>            Reporter: Robin Schimpf
>            Priority: Major
>          Time Spent: 50m
>  Remaining Estimate: 0h
> I am handling arbitrary 7zip files in my application. The extraction of the files happens
parallelized. To have better control how much memory a single file uses for extraction it
would be good to be able to pass the memory limitation to the SevenZFile.
> This is already possible when using the CompressorStreamFactory.

This message was sent by Atlassian JIRA

View raw message