Review Board 1.7.22


FLUME-2075: Flume now allows max heap size to be overriden

Review Request #11714 - Created June 7, 2013 and discarded

Edward Sargisson
Reviewers
Flume
flume-git
Flume has a default heap of 20m which sometimes appears to need to be larger. This patch allows that by users passing -Xmx<max heap size> exactly as for the JVM.
Runs correctly in my test environment.ps output shows that java has the correct parameter. jmap -heap show the correct MaxHeapSize.

Diff revision 1 (Latest)

  1. bin/flume-ng: Loading...
bin/flume-ng
Revision 22b95b8 New Change
[20] 231 lines
[+20]
232
################################
232
################################
233

    
   
233

   
234
# set default params
234
# set default params
235
FLUME_CLASSPATH=""
235
FLUME_CLASSPATH=""
236
FLUME_JAVA_LIBRARY_PATH=""
236
FLUME_JAVA_LIBRARY_PATH=""
237
JAVA_OPTS="-Xmx20m"
237
JAVA_OPTS=""

    
   
238
FLUME_MAX_MEM_SET=false
238
LD_LIBRARY_PATH=""
239
LD_LIBRARY_PATH=""
239

    
   
240

   
240
opt_conf=""
241
opt_conf=""
241
opt_classpath=""
242
opt_classpath=""
242
opt_plugins_dirs=""
243
opt_plugins_dirs=""
[+20] [20] 55 lines
[+20]
298
      ;;
299
      ;;
299
    -D*)
300
    -D*)
300
      opt_java_props="$opt_java_props $arg"
301
      opt_java_props="$opt_java_props $arg"
301
      ;;
302
      ;;
302
    -X*)
303
    -X*)

    
   
304
      if [[ $arg == -Xmx* ]]; then 

    
   
305
        FLUME_MAX_MEM_SET=true

    
   
306
      fi
303
      opt_java_props="$opt_java_props $arg"
307
      opt_java_props="$opt_java_props $arg"
304
      ;;
308
      ;;
305
    *)
309
    *)
306
      args="$args $arg"
310
      args="$args $arg"
307
      ;;
311
      ;;
308
  esac
312
  esac
309
done
313
done
310

    
   
314

   

    
   
315
if ! $FLUME_MAX_MEM_SET ; then

    
   
316
    JAVA_OPTS="-Xmx20m"

    
   
317
fi

    
   
318

   
311
# make opt_conf absolute
319
# make opt_conf absolute
312
if [[ -n "$opt_conf" && -d "$opt_conf" ]]; then
320
if [[ -n "$opt_conf" && -d "$opt_conf" ]]; then
313
  opt_conf=$(cd $opt_conf; pwd)
321
  opt_conf=$(cd $opt_conf; pwd)
314
fi
322
fi
315

    
   
323

   
[+20] [20] 125 lines
  1. bin/flume-ng: Loading...