Issue with deployed microservice in management tenant

Hello All,

I have developed one java SDK microservice and deployed in Complicity tenant and subscribed from other tenant.

It works for few minutes after that it seem it stops working.
I don’t see any error in logs as well. What could be the reason ?
Any help would be greatly apricated. Thank you.

When you say “stop working” - is it killed and restarted? Or does the service keep running but idles?

Do you see the same issue when running it on your localhost?

Hello Korbinian,

Thanks for the response. It look like service is running but not processing any thing.

I am printing one logs for every flow , after 10-15 mins i don’t see the logs in microservice’s log window.

Do you see the same issue when running it on your localhost? – No i didn’t find any issue, i tested it by running it for more than 24 hrs.

When the image of your service runs fine locally but runs in issues after deployment, this is often caused by the Service hitting the memory limits that are defined in cumulocity.json. But in this case, the service would restart rather than stop working/idling.

When you go to Administration > Ecosystem > Microservices > your-service and check the Tab “status”, are there any interesting Events (e.g. deployment-change events)?

1 Like

Hi Korbinian,

I have increased the memory limits, now it is working fine.

Thanks for your prompt answer.

1 Like

Great to hear that is working now!

One approach could be also to optimize your microservice memory usage. I don’t know your use case and implementation but in some scenarios it can be optimized by avoiding holding large objects in memory (which never get cleaned up by the GC properly). You can also monitor that by using prometheus endpoints and check if you might have a memory leak or something else.

Hi,

Also, in case you’re using a more modern version of Java than version 8 (and I hope you do :slight_smile: ), did you check this article: Migrate Java microservices from Java 8 to Java 11 - Knowledge base - Cumulocity IoT - Software AG Tech Community & Forums ?
In case you’re using java 11+ and using the maven plugin as is without custom docker file you’re likely to run into this kind of issue because of an hypertrophied JVM :slight_smile:

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.