[ 
https://issues.apache.org/jira/browse/FLINK-10317?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16959971#comment-16959971
 ] 

Maximilian Michels commented on FLINK-10317:
--------------------------------------------

{{MaxmetaspaceSize}} has something to do with the garbage collection. The 
initial value of {{MetaspaceSize}} is 12MB: 
https://github.com/openjdk/jdk/blob/2d5137e403e16b694800b2ffe18c3640396b757e/src/hotspot/cpu/ppc/c1_globals_ppc.hpp#L53

It is correct that once this value is reached, a GC will be triggered. However, 
if more metaspace is needed, then new memory will be allocated and the GC limit 
will be raised. The limit ("high watermark") is calculated based on the ratio 
of current space and the maximum set. So it does make a difference setting the 
maximum:

https://github.com/openjdk/jdk/blob/f869706f5f6c424f7c617a2eabfe30ff21a7ad1c/src/hotspot/share/memory/metaspace.cpp#L145

https://github.com/openjdk/jdk/blob/9e17946ab21434df0f6780423f7998166265af2a/test/hotspot/jtreg/vmTestbase/metaspace/gc/HighWaterMarkTest.java

> Configure Metaspace size by default
> -----------------------------------
>
>                 Key: FLINK-10317
>                 URL: https://issues.apache.org/jira/browse/FLINK-10317
>             Project: Flink
>          Issue Type: Bug
>          Components: Deployment / Scripts
>    Affects Versions: 1.5.3, 1.6.0, 1.7.0
>            Reporter: Stephan Ewen
>            Priority: Major
>             Fix For: 1.6.5, 1.7.3
>
>         Attachments: Screen Shot 2019-01-07 at 10.08.39.png, Screen Shot 
> 2019-01-07 at 10.08.47.png, Screenshot 2018-12-18 at 12.14.11.png
>
>
> We should set the size of the JVM Metaspace to a sane default, like  
> {{-XX:MaxMetaspaceSize=256m}}.
> If not set, the JVM offheap memory will grow indefinitely with repeated 
> classloading and Jitting, eventually exceeding allowed memory on docker/yarn 
> or similar setups.
> It is hard to come up with a good default, however, I believe the error 
> messages one gets when metaspace is too small are easy to understand (and 
> easy to take action), while it is very hard to figure out why the memory 
> footprint keeps growing steadily and infinitely.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to