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

    https://github.com/apache/storm/pull/875#discussion_r45507777
  
    --- Diff: storm-core/src/jvm/backtype/storm/utils/Utils.java ---
    @@ -764,5 +778,30 @@ public static long zipFileSize(File myFile) throws 
IOException{
         public static double zeroIfNaNOrInf(double x) {
             return (Double.isNaN(x) || Double.isInfinite(x)) ? 0.0 : x;
         }
    +
    +    /**
    +     * parses the arguments to extract jvm heap memory size.
    +     * @param input
    +     * @param defaultValue
    +     * @return the value of the JVM heap memory setting in a java command.
    +     */
    +    public static Double parseWorkerChildOpts(String input, Double 
defaultValue) {
    +        if (input != null) {
    +            Pattern optsPattern = Pattern.compile("Xmx[0-9]+m");
    --- End diff --
    
    This is not good enough.  It is not just an 'm' that is supported.
    
    From http://docs.oracle.com/javase/7/docs/technotes/tools/windows/java.html
    
    ```
    -Xmxn
    
        Specifies the maximum size, in bytes, of the memory allocation pool. 
This value must a multiple of 1024 greater than 2 MB. Append the letter k or K 
to indicate kilobytes, or m or M to indicate megabytes. The default value is 
chosen at runtime based on system configuration.
    ```
    
    I have also seen 'g' and 'G' work for gigabytes too.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to