We are creating file processing service using spring boot. We are getting XML file as Clob from DB and converting it to String( We will then unmarshall String to JAXBElement for processing).

Since it is file processing service our design for this service to run as PCF Task application so that when app completes processing the file, it will terminate and free up cloud resource(RAM,Disk).

When we are processing small files(tried till 60MB) with PCF task application we have no issues. But when we are trying to process 150 MB file,Task application instance is terminating without any error log.

We deployed same application as PCF web application instance and used REST API to process the file. Then we are able to process the file.

Task App Configuration :

We have started with 1GB RAM Memeory and 1GB Disk space for a Task instance and Increased RAM Memory till 5GB and 2GB Disk space still App is not able to process the file.

Web App Configuration:

With 2Gb RAM and 1GB Disk space. With REST API to start file processing we are able to process the file.

Why is this difference?

Code Snippet:

if (clob != null) {

  BufferedReader reader = new BufferedReader(new InputStreamReader(clob.getAsciiStream()));

  String read = null;

  StringBuffer sb = new StringBuffer();

   LOGGER.info("Before While Loop");

   while ((read = reader.readLine()) != null) {

  sb.append(read);

  }

   LOGGER.info("After While Loop");

  String xml = sb.toString();

}

PCF Task App Log:

2020-04-02T15:54:19.787+05:30 [APP/TASK/Bulk File/0] [OUT] 2020-04-02 10:24:19.786 INFO 15 --- [ main] c.f.g.s.s.impl.ServiceImpl : Before While Loop

2020-04-02T15:54:29.180+05:30 [APP/TASK/Bulk File/0] [OUT] 2020-04-02 10:24:29.180 INFO 15 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...

2020-04-02T15:54:29.220+05:30 [APP/TASK/Bulk File/0] [OUT] 2020-04-02 10:24:29.220 INFO 15 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.

2020-04-02T15:54:29.490+05:30 [APP/TASK/Bulk File/0] [OUT] Exit status 1

2020-04-02T15:54:29.630+05:30 [CELL/0] [OUT] Cell 17fd36a9-3f6b-4957-89b5-83639048dadf stopping instance 204e6fc5-6998-47d3-89dc-59ac702caccd

2020-04-02T15:54:29.630+05:30 [CELL/0] [OUT] Cell 17fd36a9-3f6b-4957-89b5-83639048dadf destroying container for instance 204e6fc5-6998-47d3-89dc-59ac702caccd
0

There are 0 best solutions below