commons-issues mailing list archives

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

     [ https://issues.apache.org/jira/browse/COMPRESS-481?focusedWorklogId=228292&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-228292
]

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
URL: https://github.com/apache/commons-compress/pull/76#discussion_r275735857
 
 

 ##########
 File path: src/main/java/org/apache/commons/compress/archivers/sevenz/LZMA2Decoder.java
 ##########
 @@ -33,9 +34,12 @@
 
     @Override
     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
{
         try {
             final int dictionarySize = getDictionarySize(coder);
+            if ((dictionarySize / 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:
users@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 228292)
    Time Spent: 40m  (was: 0.5h)

> Allow passing memory limit for extraction to SevenZFile
> -------------------------------------------------------
>
>                 Key: COMPRESS-481
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-481
>             Project: Commons Compress
>          Issue Type: Improvement
>    Affects Versions: 1.18
>            Reporter: Robin Schimpf
>            Priority: Major
>          Time Spent: 40m
>  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
(v7.6.3#76005)

Mime
View raw message