Github user chtyim commented on a diff in the pull request:

    https://github.com/apache/incubator-twill/pull/66#discussion_r41459425
  
    --- Diff: 
twill-core/src/main/java/org/apache/twill/internal/ApplicationBundler.java ---
    @@ -178,8 +181,42 @@ public void createBundle(Location target, 
Iterable<Class<?>> classes, Iterable<U
         }
       }
     
    +  /**
    +   * Creates a {@link ByteArrayOutputStream} which includes all the given 
classes and
    +   * all the classes that they depended on.
    +   * The  {@link ByteArrayOutputStream}
    +   * will also include all classes and resources under the packages as 
given as include packages
    +   * in the constructor.
    +   *
    +   * @param resources Extra resources to put into the jar file. If 
resource is a jar file, it'll be put under
    +   *                  lib/ entry, otherwise under the resources/ entry.
    +   * @param classes Set of classes to start the dependency traversal.
    +   * @return ByteArrayOutputStream
    +   * @throws IOException
    +   */
    +  public ByteArrayOutputStream getBundleAsStream(Iterable<Class<?>> 
classes,
    --- End diff --
    
    So this could end up using a lot of heap space (and double it when 
`ByteArrayOutputStream.toByteArray()` is being called). Why it needs to be kept 
all in memory?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to