Project

General

Profile

Download (1.59 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2012 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.cdm.server;
10

    
11
/**
12
 * @author a.kohlbecker
13
 * @date May 10, 2013
14
 */
15
public class AssumedMemoryRequirements {
16

    
17
    // these values are best obtaines by using the following command sequence:
18
    // export JPID=$(jps | grep Jetty | awk '{ print $1}'); jcmd $JPID GC.run; sleep 1;  jstat -gc $JPID | sed -e 's/ \+/\t/g'
19

    
20
    /*
21
     * From Java 8 on PermGen is replaced by the Metaspace
22
     *
23
     * Metaspace capacity:
24
     *
25
     * By default class metadata allocation is
26
     * limited by the amount of available native memory (capacity will
27
     * of course depend if you use a 32-bit JVM vs. 64-bit along with OS
28
     * virtual memory availability). A new flag is available
29
     * (MaxMetaspaceSize), allowing you to limit the amount of native
30
     * memory used for class metadata. If you don’t specify this flag,
31
     * the Metaspace will dynamically re-size depending of the
32
     * application demand at runtime.
33
     */
34

    
35
    public static final int KB = 1024;
36
    public static final long MB = 1024 * KB;
37

    
38
    /**
39
     * 25% on to on the idle footprint
40
     */
41
    private static final double FREE_HEAP = 1.25;
42

    
43
    /*
44
     * based on the HU value of the  jstat -gc output
45
     */
46
    public static final long HEAP_PER_INSTANCE = (long)(153 * MB * FREE_HEAP);
47
    public static final long HEAP_CDMSERVER = (long) (15 * MB * FREE_HEAP);
48

    
49
}
(1-1/6)