Camunda 7.20 in Spring Boot App with PostgreSQL - memory usage

Hi everyone,
my name is Luca and I’m using Camunda 7 CE (version 7.20.0) to manage a series of processes that control robots in an industrial plant, these are the dependencies of my project:

vaadinVersion=24.3.0
hillaVersion=2.2.0
springVersion=3.1.2
camundaVersion=7.20.0
camelVersion=4.1.0
hazelcastVersion=5.2.4
postgresqlVersion=42.6.0
jibVersion=3.4.2

The spring boot application that contains the Camunda engine, is deployed with a .jar file executed as a service among the Windows services.
We are talking about a Camunda instance that in production should support the load of 5/10 processes at the same time (so very few reading the online documentation).
At the moment Camunda must control the movements of only 1 robot.
When the .jar is running as a service, and I check its resource usage from the task manager, I see that it easily consumes 2 GB of RAM, this value seems very strange to me.
I don’t know what to expect when instead of having to manage 1 robot, I will have to manage a fleet of 10 robots.
It seems to me a high RAM consumption by the engine. Is it possible?
I attach below the application.yaml file with all the parameters that I inserted:

management:
  endpoints:
    web:
      exposure:
        include:
          - prometheus
  endpoint:
    prometheus:
      enabled: true
  metrics:
    export:
      prometheus:
        enabled: true

#spring.datasource.url: jdbc:h2:file:./camunda-h2-database
spring.datasource:
  url: jdbc:postgresql://localhost:5432/camunda_cg
  username: fluid
  password: fluid
  driver-class-name: org.postgresql.Driver

#logging:
#  level:
#    root: info
#    org.springframework: debug
#    org.camunda: debug

camunda.bpm.admin-user:
  id: admin
  password: admin

server:
  port: 8081

camunda:
  bpm:
    history-level: activity
    job-execution:
      wait-time-in-millis: 1000
      max-wait: 5000
    generic-properties:
      properties:
        historyCleanupBatchWindowStartTime: "00:01"
        historyCleanupBatchWindowEndTime: "06:59"
        historyCleanupStrategy: removalTimeBased
        batchOperationHistoryTimeToLive: "P1D"
        historyRemovalTimeStrategy: "end"
        historyCleanupEnabled: true
        historyTimeToLive: P1D

Based on your experience are there other parameters, that could help me keep the workload low?
It seems strange to me that if I do not have processes running, the engine still uses 1 or 2 GB.
The engine is not distributed, it is running only on a Windows server machine.

I would like to point out that I have not run any queries to optimize the indexes, the database is the one that is initially created.
In theory, if the database slowed down or Camunda slow, then it could be an index problem, but not if Camunda uses too much RAM.
Please tell me if I have left out any useful details for a more in-depth analysis.

I installed Prometeus last night and so since yesterday I have started to collect some metrics from the production environment, I could attach them at the end of this day.

Thank you in advance,
Luca

Luca,

Welcome to the user forum!

My initial thought would be that the ~1.5GB RAM usage would be the Java reservation of memory. If you adjust the Java Parameters, you could bring it down. However, if you do that, and Java runs out of memory, the entire stack would fail.

As Camunda 7 is End-of-Support / End-of-Development later this year, I would move toward running a Camunda 8 stack. This also runs on Java, so would still likely have the high memory use, but you would not need to re-architect a running system.

Hi,
thank you very much for the feedback.

I’ve been working with Camunda 7 CE for 6 months because we are creating an app for managing robots in an industrial environment and it is a different use compared to the most common uses of Camunda.
Actually I’m not interested in necessarily lowering the value of the RAM used if I risk to run into an out of memory error.

Today I have tested that starting Camunda 7.20.0 as a service on Win, the service uses between 700 MB~1.5 GB without process instances active.
I tried to start about 100 process instances at the same time, and in reality the use of the RAM was not affected, so it actually seems to be a quantity of memory that it allocates at startup and then it manages the memory based on the load at that moment.

From what you told me, I shouldn’t necessarily focus on wanting to lower RAM usage at all costs if I’m around these values.

I know that version 7 is about to end in EOF, my doubt in fact is to continue using 7 and hope for community support or to go towards version 8.
At the moment I have not even looked at how much effort would be necessary for this migration. Would you recommend it?

Regarding version 7, do you think it makes sense to analyze the indexes that are not created by default on Postgrs and eventually create them?

Thank you very much for the support.

Luca,

I’m a bit of an oddity on here - I’m not as technical as I seem.
I’m a Business Analyst, and mostly use Camunda Modeler

If you are an experienced DBA, I would say, absolutely review the indexes. If not, I would suggest leaving the defaults. Adding too many indexes can cause just as many problems as not enough indexes. However, that is something that you can tune, and get a really efficient system.

It’s not clear how your system is set up, but there are examplars around on RPA with C8. If you’ve used external workers model, then it’s not too bad to migrate. If you’ve gone integrated model, it’s going to be a lot of work.