How is the heapsize setting for a CF Liberty instance with a particular memory limit - ibm-cloud

For a CF App (Liberty Runtime based) running on bluemix, I have set a MEMORY_LIMIT say 2G. I dont have any JAVA_OPTS set for setting the -Xms and -Xmx values. How is the heapsize memory allotted by bluemix ? Any range it sets by default ?
Please advice.

The Liberty buildpack uses a ratio to calculate the heap size according to your memory limit.
heap_size_ratio The ratio that is used to calculate the maximum heap
size. The default heap size ratio is 0.75 (75% of the total available
memory).
https://github.com/cloudfoundry/ibm-websphere-liberty-buildpack/blob/master/docs/ibm-jdk.md
new_heap_size = mem * heap_size_ratio
https://github.com/cloudfoundry/ibm-websphere-liberty-buildpack/blob/master/lib/liberty_buildpack/jre/ibmjdk.rb#L175

Related

caffeine cache - Limit size to x MB

Is it possible to set caffeine cache size limited to x MB ?
If this is not possible, is there any performance reason for not doing it [For my understanding].
I checked with weighter, . As per my understanding weight is calculated based on number of time key was accessed. If i understand weight wrongly please guide me with right link
My use case is to set cache size to x-MB and evict once we reach x-MB
Reference i used:
https://github.com/ben-manes/caffeine/wiki/Eviction
https://www.tabnine.com/code/java/methods/com.github.benmanes.caffeine.cache.Caffeine/maximumWeight
weight based eviction : https://www.baeldung.com/java-caching-caffeine
Thanks
Jk

Max value of Xmx and Xms in SpringToolSuite4

What is the max memory size in SpringToolSuite4.ini for STS for the following parameters?
-Xms
-Xmx
are the above parameters customized, if yes how much size we can increase for both?

Interpreting.Q.w[] for potential problems?

From this page we know that .Q.w[] gives us for example:
used| 108432 / bytes malloced
heap| 67108864 / heap bytes available
peak| 67108864 / heap high-watermark in bytes
wmax| 0 / workspace limit from -w param
mmap| 0 / amount of memory mapped
syms| 537 / number of symbols interned
symw| 15616 / bytes used by 537 symbols
If I wanted to monitor the instance for memory issues (eg. memory full) should I be looking at used or heap or a combination?
If you want to monitor how much is currently being used you would use used but it's only a rough estimate of the actual used as it doesn't take into account the memory used by interned strings (symbols) or memory-mapped files.
Monitoring the heap is useful to get a sense of how your memory spikes (and peak gives what the max spike is) but it wouldn't necessarily be ideal for informing you if you're close to your limit because if you have a big memory spike and you hit your limit then the process will die before you have a chance to monitor the fact that the spike was close to the limit.
Ultimately I would monitor both (and peak) and allow yourself buffers in both cases. Have a low-level alert if the heap/peak reaches say 50% of the limit, higher levels at 60%, 70% etc. Then also monitor your used as a percentage of your heap/peak. If your used is a high percentage of your heap - and your heap is a high percentage of your limit - then this could be alarming. Essentially your process could either be:
Low-medium memory usage but spiking:
If the used is generally a low-medium percentage of the heap/peak then your process is using low-med memory but spiking. This is pretty harmless and expected if crunching a lot of data
used is a high % of heap/peak and heap/peak is a high % of max
Here you might have a situation where a process is storing more and more memory without releasing. So the used is continually growing and the heap/peak is continually growing with it. This is a problem if unchecked.
So essentially you want to capture behaviour 2 while allowing behaviour 1.
There are some other behaviour patterns also but this would be the general gist. Whether or not automatic garbage collect is enabled also plays into it. If auto garbage collect isn't enabled and used is a lot less than heap then this process is hogging memory that it doesn't need to.

How the size of stack and heap memory bound is determined in iPhone OS?

How is internally the maximum size of stack and Heap is set? How can we determine its maximum size? I am not using it for any of my projects. But this is just out of curiosity.
iPhone/iOS has support for virtual memory (just no backing store in normal use), and a virtual address space much larger than physical RAM. So the maximum size for either stack or heap is until the sum of all (maybe dirty) memory use (in allocated pages) runs out of that available for the current app process/sandbox, which will vary depending on what else is running on the system.

is there stack size in iphone?

Every RAM must have stack and heap (like CS,ES,DS,SS 4 segments).but is there like stack size in iphone,is only heap available?some tutorial say when we increase stack size , heap will be decreased,when we increase heap size ,stack will be decreased ...is it true..? or fixed stack size or fixed heap size ? any help please?
RAM does not have stack and heap (these are program use constructs and not part of the memory physically), nor do the Intel segment registers apply to ARM.
An application's thread, since it is a C application, has a stack. The stack size is bounded on the device, and in most cases cannot exceed a certain size (1MB for the main thread on iPhone OS), nor can it be shrunk.
Heap is also limited. The only way your stack size can influence the available heap is by creating threads, where the new stacks will occupy memory which could be used by the heap allocator. On iPhone OS, the minimum stack size is 16KB. For more information, read the threading documentation.