bellsoft-liberica | Cloud Native Buildpack that provides the Bellsoft Liberica
kandi X-RAY | bellsoft-liberica Summary
kandi X-RAY | bellsoft-liberica Summary
The Paketo BellSoft Liberica Buildpack is a Cloud Native Buildpack that provides the BellSoft Liberica implementations of JREs and JDKs. This buildpack is designed to work in collaboration with other buildpacks which request contributions of JREs and JDKs.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Build builds a new build
- main is the main entry point for libp2 .
bellsoft-liberica Key Features
bellsoft-liberica Examples and Code Snippets
Community Discussions
Trending Discussions on bellsoft-liberica
QUESTION
I'm using spring boot 2.5.6 and I'm generating the docker image with the spring boot maven plugin. I'm deploying the application using AWS EKS with nodes managed by fargate.
The plugin configuration is the following
...ANSWER
Answered 2021-Nov-22 at 08:22Posting this out of comments for better visibility.
An important thing to mention is when free
command is run inside a pod's container, it shows all available memory on the node where this pod is scheduled and running.
At this point it's very important to have memory resources
and limits
for java applications since JVM memory allocation can be set incorrectly if it happens by the application.
There are two main options for resource allocation (in this particular case is memory
):
requests (
spec.containers[].resources.requests.memory
) - kubernetes scheduler has to find a node which has requested amount of memory, not less than specified.It's very important to set the
requests
reasonably since it's used for scheduling and there are chances that kubernetes scheduler won't be able to find a sufficient node with enough free memory to schedule the pod - good example of incorrect requestslimits (
spec.containers[].resources.limits.memory
) - kubelet insures that pod will not consume more than specified in limits, since containers in pod are allowed to consume more than requested.It's also important to have
limits
set up for predictable resource consumption since containers can exceed requested memory and consume all node's memory untilOOM killer
is involved. Possible cases when limits are not set
QUESTION
I've got a problem with this integration. I use MongoDB based on docker without problems, but when I create a Docker Compose, the Spring Boot WebFlux stop to find the Mongo. I'm trying to find the problem, but I don't know how to solve it.
The service log shows me this problem:
...ANSWER
Answered 2021-Aug-05 at 15:30So what exactly is the problem here? Without knowing more about the application, I can't really tell why it's trying localhost
first, but it seems like it's able to connect to mongo running on the person-db
container after that based on these logs:
QUESTION
I am building Docker image with the spring-boot-maven-plugin that is deployed to AWS BeanStalk. I use the plugin through the 2.4.3 spring boot starter dependency) However, when the container is started, I get the error below. I am a bit new in the buildpack stuff, but tried to solve it by playing with the Buildpack env variables as described on the website. But it had absolutely no effect on the values shown in the error log below. I found this github issue but not sure if it's relevant and how to use it.
I am using AWS Micro instance that has 1G total RAM, it performs a rolling update, so at the time of starting the new image, the other is also running till the new one started with success, so to start the container could as well be that only 300MB is available, however, during normal run it has more available.
Why do I need this memory calculation? Can't I just disable it? When I build a Docker image of the app.jar and deploy it to aws beanstalk, it works well without any memory settings:
docker build . --build-arg JAR_FILE=./target/app.jar -t $APPLICATION_NAME
But I would love to use the image build through the spring-boot-maven plugin. Please some advice on how to solve this?
...ANSWER
Answered 2021-May-19 at 01:58OK, so here's what this is telling us:
Calculating JVM memory based on 274300K available memory
The memory calculator is detecting a maximum amount of memory available in the container as 274300KB, or about 274M.
fixed memory regions require 662096K which is greater than 274300K available for allocation: -XX:MaxDirectMemorySize=10M, -XX:MaxMetaspaceSize=150096K, -XX:ReservedCodeCacheSize=240M, -Xss1M * 250 threads
This message is saying that the memory calculator needs at least 662096KB or 662M in its present configuration.
It's also breaking down why it needs/wants that much:
- 10M for direct memory
- 150096K for metaspace
- 240M for reserved code cache
- 250M for threads (thread stack specifically)
That's not counting the heap which will require more (you seem to want at least 1G for the heap).
This leaves two possibilities:
- The container is not provisioned large enough. You need to give it more memory.
- The memory calculator is not correctly detecting the memory limit.
If you suspect #2, look at the following. The memory calculator selects it's max memory limit (i.e. the 274M in the example above) by looking in these places in this order.
- Check the configured container memory limit by looking at
/sys/fs/cgroup/memory/memory.limit_in_bytes
inside the container. - Check the system's max available memory by looking at
/proc/meminfo
and theMemAvailable
metric, again, from inside the container. - If all else fails, it'll end up with a 1G fallback.
If it's truly not working as described above, please open a bug and provide as much detail as you can.
Alternatively, you may tune the memory calculator. You can instruct it to give less memory to specific regions such that you reduce the total memory required to be less than the max available memory.
You can do that by setting the JVM memory flags in the JAVA_TOOL_OPTIONS
env variable (you have BPE_JAVA_TOOL_OPTIONS
which isn't right). See https://paketo.io/docs/buildpacks/language-family-buildpacks/java/#runtime-jvm-configuration.
For example, if you want to override the heap size then set -Xmx
in JAVA_TOOL_OPTIONS
to something custom. The memory calculator will see what you've set and adjust the remaining memory settings accordingly. Override as many as necessary.
To get things down to fit within 274M of RAM, you'd have to go really small. Something like -Xss256K -XX:ReservedCodeCacheSize=64M -XX:MaxMetaspaceSize=64 -Xmx64M
. I didn't test to confirm, but this shows the idea of what you need to do. Reduce the memory settings such that the sum total all fits within your max memory limit for the container.
This also does not take into account if your application will actually be able to run within such small limits. If you go too small you may at some point see OutOfMemoryErrors or StackOverflowErrors, and your app will crash. You can also negatively impact performance by reducing code cache size too much since this is where the JIT stores byte code that it's optimized to native code. You could even cause GC issues, or degraded performance due to too much GC if the heap isn't sized right. In short, be very careful if you're going to do this.
QUESTION
I am using spring-boot-maven-plugin to build a docker image from my app with this command:
...ANSWER
Answered 2021-Jan-13 at 21:46It depends on your goal here. It sounds like you want to change the max direct memory in your container when your app runs so you should be just doing what you indicated works here (and what's listed in the docs).
docker run -e JAVA_TOOL_OPTIONS=-XX:MaxDirectMemorySize=64M docker.io/example/app-name:0.0.1
The doc link you're referencing is talking about configuring options at runtime which is what you are doing with the env variables.
QUESTION
Having a Spring Boot app I tried to build it using the spring-boot-maven-plugin
goal mvn spring-boot:build-image
. But the build fails downloading the bellsoft-jre11.0.9.1+1-linux-amd64.tar.gz
from github.com
, since I don't have access to it from my build pipeline:
ANSWER
Answered 2020-Dec-17 at 15:29Paketo Buildpacks may download dependencies from the internet. For example, the Java Buildpack will download the BellSoft Liberica JRE from the Liberica github releases by default. If a dependency URI is inaccessible from the build environment, a binding can be used to map a new URI to a given dependency.
For now configuring bindings isn't possible using the spring-boot-maven-plugin (or the Gradle plugin). Therefore we need to switch over to pack CLI.
=== Use pack CLI with bindings to configure a different JDK download uri ===
The pack docs tell us about the general layout of a binding directory (/platform/bindings
is later created inside the pack build container):
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install bellsoft-liberica
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page