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

ASF GitHub Bot logged work on COMPRESS-481:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 16/Apr/19 10:45
            Start Date: 16/Apr/19 10:45
    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_r275737222
 
 

 ##########
 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:
   sorry about the previous comment which applied to `LZMAInputStream`. 
`LZMA2InputStream` also provides a static `getMemoryUsage` which might be a 
better option to calculate memory consumption.
 
----------------------------------------------------------------
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:
us...@infra.apache.org


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

    Worklog Id:     (was: 228299)
    Time Spent: 1h  (was: 50m)

> 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: 1h
>  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)

Reply via email to