on ‎2020 Sep 27 7:31 AM
Hello everyone,
I'm having a difficulty to allocate less memory for my application.
We started to write APIs with SAP Cloud WEB IDE.
I have 3 java applications that are already running on the server.
For some reason, each java application has lower bound of 600+ MB for publishing although the application is using only 100-200MB.
Currently we have 2GB of memory allowed.
How do we change the lower bound to be less than 600+ MB?
Are there any settings in the cloud platform cockpit for it?
Thank you,
Dor Alon
Request clarification before answering.
Hi yaniv200976,
Java memory parameters can be tweaked in the JAVA_OPTS JBP options on the Java Buildpack.
Please check:
If you really need 600MB to start your application, there is really no way to share this amount of memory with other applications. Suppose you have your app stopped and other Java Applications running, taking 1.5GB os the available memory. If you try to start your application, since it requires 600MB it will not be able to start. So you would have to stop another app to start yours and later start the app you have stopped previously - which makes no sense at all. Therefore, your application will use 600MB of the available memory in your space.
Try to understand why your application requires 600MB to boot up. Is there another way to prevent this from happening?
If you are still having issues, could you please share your mta.yaml file?
Best regards,
Ivan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi yaniv200976,
Did you setup the JBP_CONFIG_JAVA_OPTS in your Java module? Are you able to run the same application with with SAP_JVM locally while setting it with memory parameters to fit the JVM into 100MB?
I don't see that in your MTA.yaml and it seems to me that the Memory Calculator V2 is enabled and its settings are the defaults.
Could you please share the java module's settings related to JBP configuration. It should look like this:
modules:
- name: memory
type: java
path: target/memory.jar
parameters:
disk-quota: 256M
memory: 256M
properties:
JBP_CONFIG_JAVA_OPTS: "[java_opts: '-Xmn10M -Xms30M -Xmx100M -Xss3M ']"<br>Please note, that You should figure out any of the -X parameters on your on using a local JVM so it can safely occupy at most 256M (probably using a profiler - like the one you'll find in SAPJVM).
You say that you application doesn't use more than 100MB - and I believe you. However, you need to also account the memory required by the JVM. So, when you tweak the -X parameters, you have to make sure it fit all into a JVM of size 100MB.
I've done so using the same parameters on a simple Hello World based application using Jetty.
Best regard,
Ivan
| User | Count |
|---|---|
| 12 | |
| 9 | |
| 7 | |
| 5 | |
| 4 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.