# Cloud Foundry Java Buildpack
# Copyright 2013-2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Configuration for JRE repositories keyed by vendor
# If Java 7 is required, permgen will be used instead of metaspace. Please see the documentation for more detail.
---
jre:
  version: 1.8.0_+
  repository_root: ! '{default.repository.root}/openjdk/{platform}/{architecture}'
memory_calculator:
  version: 1.+
  repository_root: ! '{default.repository.root}/memory-calculator/{platform}/{architecture}'
  memory_sizes:
    metaspace: 80m..
    permgen: 80m..
    stack: 228k
  memory_heuristics:
    heap: 60
    metaspace: 15
    permgen: 10
    stack: 5
    native: 20

# Cloud Foundry Java Buildpack
# Copyright 2013-2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Configuration for JRE repositories keyed by vendor
# If Java 7 is required, permgen will be used instead of metaspace. Please see the documentation for more detail.
---
jre:
  version: 1.8.0_+
  repository_root: ! '{default.repository.root}/openjdk/{platform}/{architecture}'
memory_calculator:
  version: 1.+
  repository_root: ! '{default.repository.root}/memory-calculator/{platform}/{architecture}'
  memory_sizes:
    metaspace: 80m..96m
    permgen: 80m..
    stack: 228k
  memory_heuristics:
    heap: 60
    metaspace: 15
    permgen: 10
    stack: 5
    native: 20

Set a maximum value of 96m for the metaspace.
Set a maximum value of 96m for the metaspace.

This is needed to prevent oom-killer running too frequently due to using too much native memory.