[jboss-jira] [JBoss JIRA] (WFCORE-2959) Export a low MALLOC_ARENA_MAX value in standalone.conf and domain.conf

Andrig Miller (JIRA) issues at jboss.org
Wed Jun 14 16:27:00 EDT 2017


    [ https://issues.jboss.org/browse/WFCORE-2959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13421425#comment-13421425 ] 

Andrig Miller commented on WFCORE-2959:
---------------------------------------

[~dmlloyd]I don't see how it can cause memory allocation performance to drop, accept at startup of the JVM itself.  The JVM doesn't call MALLOC often, and only in situations with the heap settings where the min and max are not the same value will it call MALLOC after startup.  Or the case of when there is no max set for MetaSpace, that could generate calls to MALLOC during runtime, but it also will be limited.  In testing 1 vs. 2, we didn't see any real difference, but if we want to do 2 to feel more comfortable that is fine by me.

> Export a low MALLOC_ARENA_MAX value in standalone.conf and domain.conf
> ----------------------------------------------------------------------
>
>                 Key: WFCORE-2959
>                 URL: https://issues.jboss.org/browse/WFCORE-2959
>             Project: WildFly Core
>          Issue Type: Enhancement
>          Components: Scripts
>            Reporter: Brian Stansberry
>            Assignee: Tomaz Cerar
>
> This is a task that came out of research done by [~andy.miller] on WF/EAP memory use in cloud environments.
> Our launch scripts for *nix environments should set MALLOC_ARENA_MAX, e.g.
> export MALLOC_ARENA_MAX=${MALLOC_ARENA_MAX:-1}
> See http://info.prelert.com/blog/java-8-and-virtual-memory-on-linux for background.
> The default glibc settings of allowing up to 128 malloc arenas make very little sense for a java application, since the vm asks the os for a few large memory allocations and then manages those areas itself. Leaving that default setting in place will result in a very large virtual memory size for the VM. It's just virtual, not resident, memory, so controlling this to a large extent is just a matter of having a better image for people who don't understand the distinction. But as is mentioned in the linked blog post's discussion of mlockall() and Elasticsearch, there may be some more concrete implications as well.
> The initial recommendation on this was to set the value to 1, but this bears some research/discussion. For example hadoop uses 4 (https://issues.apache.org/jira/browse/HADOOP-7154), and a bit of googling of "MALLOC_ARENA_MAX java" leads to some entries mentioning using 2 or 3.



--
This message was sent by Atlassian JIRA
(v7.2.3#72005)


More information about the jboss-jira mailing list