Project

General

Profile

Download (1.8 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
 */
16
public class AssumedMemoryRequirements {
17

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

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

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

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

    
44

    
45
	/*
46
	 * JAVA 7
47
     * based on the PC value of the  jstat -gc output
48
     */
49
	public static final long PERM_GEN_SPACE_PER_INSTANCE = 55 * MB;
50
    public static final long PERM_GEN_SPACE_CDMSERVER = 20 * MB;
51

    
52
    /*
53
     * based on the HU value of the  jstat -gc output
54
     */
55
    public static final long HEAP_PER_INSTANCE = (long)(153 * MB * FREE_HEAP);
56
    public static final long HEAP_CDMSERVER = (long) (15 * MB * FREE_HEAP);
57

    
58
}
(1-1/6)