0

I am using task-launcher-sink 1.3.1.RELEASE Version and SDCF Version 1.4.0.RELEASE to launch my task at PCF. The default allocated heap for the my task is not sufficient to run it, as my task is processing data of larger size. So, it is giving the heap allocation error , Resource exhaustion event: the JVM was unable to allocate memory from the heap.

I am able to run my task by providing JAVA_OPTS=-Xms128m -Xmx512m in MyTask>Setting>User Provided Environment Variables manually on PCF. But as I am using task-launcher-sink, this parameter to provided as environment variable or deployment parameter.

Below are the Logs I am getting:

2019-04-26T11:32:35.522+05:30 [APP/TASK/MyTask/0] [OUT] Memory usage:

2019-04-26T11:32:35.523+05:30 [APP/TASK/MyTask/0] [OUT] Heap memory: init 16777216, used 108648024, committed 344653824, max 344653824

2019-04-26T11:32:35.524+05:30 [APP/TASK/MyTask/0] [OUT] Hint: Heap memory is over 95% full. To increase it, increase the container size.

2019-04-26T11:32:35.526+05:30 [APP/TASK/MyTask/0] [OUT] Non-heap memory: init 2555904, used 103426448, committed 105512960, max 631562240

2019-04-26T11:32:35.527+05:30 [APP/TASK/MyTask/0] [OUT] Memory pool usage:

2019-04-26T11:32:35.528+05:30 [APP/TASK/MyTask/0] [OUT] Code Cache: init 2555904, used 18623104, committed 18743296, max 251658240

2019-04-26T11:32:35.529+05:30 [APP/TASK/MyTask/0] [OUT] Metaspace: init 0, used 75305304, committed 76939264, max 194146304

2019-04-26T11:32:35.530+05:30 [APP/TASK/MyTask/0] [OUT] Compressed Class Space: init 0, used 9498136, committed 9830400, max 185757696

2019-04-26T11:32:35.531+05:30 [APP/TASK/MyTask/0] [OUT] Eden Space: init 4521984, used 3132632, committed 95092736, max 95092736

2019-04-26T11:32:35.533+05:30 [APP/TASK/MyTask/0] [OUT] Survivor Space: init 524288, used 0, committed 11862016, max 11862016

2019-04-26T11:32:35.534+05:30 [APP/TASK/MyTask/0] [OUT] Tenured Gen: init 11206656, used 105515392, committed 237699072, max 237699072

2019-04-26T11:32:35.534+05:30 [APP/TASK/MyTask/0] [ERR] jvmkill killing current process

2019-04-26T11:32:35.534+05:30 [APP/TASK/MyTask/0] [OUT] 2019-04-26 06:02:35

Rosh
  • 11
  • 4

1 Answers1

0

You have to pass the -Xms128m -Xmx512m options as a deployment property of the TaskLaunchRequest:

deployer.{app}.cloudfoundry.javaOpts=-Xms128m -Xmx512m

where {app} stands for the name of your SCDF Task app, i.e. the identifier referenced in the definition of your task create SCDF shell command (not to be confused with the PCF app name).

In addition, if necessary, you should be able to control the total amount of memory made available to the PCF app (as far as the quota allows) by adding another deployment property:

deployer.{app}.cloudfoundry.memory=1g

Note that I found this out by studying and debugging the task launcher code. The documentation could be a little clearer in this regard.

Stefan Reisner
  • 607
  • 5
  • 12