High heap memory usage on Moqui instance

Hi all,

We are experiencing high heap memory usage on our deployed Moqui instance.

The current heap memory is 4 GB (-Xms) and we are observing memory usage around 70-80% continuously even though system is idle at many instances.

If anyone has experienced similar issue, any inputs would be highly appreciated.

Thanks

1 Like

Just to add more details to it, we are dealing with File I/O operations by generating bulk feed files in Moqui.

The generic pattern used in implementation is

try {
    //json file
    File feedFile = new File(jsonFilePath)

    PrintWriter pw = new PrintWriter(StandardCharsets.UTF_8, feedFile)

    JsonFactory jfactory = new JsonFactory();
    JsonGenerator jGenerator = jfactory.createGenerator(pw)
    jGenerator.writeStartArray()

    /*
    data preparation here, the object (dataMap) to be written in the JSON  
    */
   
    new ObjectMapper()
                    .writerWithDefaultPrettyPrinter().writeValue(jGenerator, dataMap)

    jGenerator.writeEndArray()
    jGenerator.close()
    pw.close()
} catch (IOException e) {
    logger.info("Error preparing fulfilled order items Feed file", e)
}

We have closed the resources PrintWriter and JsonGenerator, but is it possible due to some reason, the resource leak is happening?

Any inputs on this will be helpful here.

Thanks

1 Like