kharlo2
kharlo2

Reputation: 3

Error R14 (Memory quota exceeded) Jhipster with EHCache on Heroku

I have a jhipster generated app on heroku and since the first deploy, without doing any modifications, I have the classic Error R14 (Memory quota exceeded). After several investigations I still can not fix this issue. Now I have 300 user, the usage of the application is very basic, but still I want to get rid of this errror. What I have done so far:

1- set -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap on the JAVA-TOOLS options of heroku

2- I wanted to also set the -Xmx300m , but given the fact that heroku already applies -Xmx256m, I think is no needed to reset this value.

The last comments that I have read, points me to remove the usage of the cache, something that I think will decrease the performance of the app cause all the sql queries will go to the database. I am using EHCache as a local cache, have any of you guys fixed this situation by removing or reconfiguring EHCAche? or is there any recommendation to fix this situation?

My application has never crashed, but I fear that the performance will degrade overtime.

Upvotes: 0

Views: 252

Answers (1)

codefinger
codefinger

Reputation: 10318

Try using these JAVA_OPTS:

-Xmx256m -Xss512k -XX:CICompilerCount=2 -XX:ReservedCodeCacheSize=50m -XX:MaxMetaspaceSize=80m -XX:ParallelGCThreads=3 -Dfile.encoding=UTF-8

And these Spring opts:

--server.undertow.io-threads=1

This is similar to the ideal configuration we found for the jhipster-registry. The idea is to reduce the number of threads (and thus the memory for thread stacks) and reduce other off-heap memory.

Upvotes: 0

Related Questions