yes, i have some idea.
yet again, lack of info.
how the container is started?
there are various levels to confine resources usage under containers but i have no valuable info here.
so, unless i see something like "how the container is started’ and info about the hardware capabilities of the VM subject to this, i will just wait.
My crystal globe is broken.
Please find below how we start the docker container in Jenkins pipeline:
withCredentials([string(credentialsId: 'katalon-api-key', variable: 'KATALON_API_KEY')]) {
withDockerContainer(image: "${BUILD_IMAGE_KATALON}",
args: "-u=root -m 4G --name ${JOB_DOCKER_NETWORK} --network=${JOB_DOCKER_NETWORK} \
") {
sh("""#!/bin/bash
# set locale environment variable LC_ALL to UTF-8 encoding
export LC_ALL=C.UTF-8
export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8
# running the katalon job to run the test suite or collection with the correct profile
katalonc.sh -projectPath="${WORKSPACE}" \
-browserType="Chrome" \
-retry=0 \
-statusDelay=15 \
-testSuiteCollectionPath="test_suite_collection_test" \
-executionProfile="TEST" \
--config -g_languageCode="en" \
-apiKey="${KATALON_API_KEY}"
""")
}
}
About the capabilities of the VM, I need to contact DevOps team to get the information, I don’t have access on that machine.
If there is a parameter I can use to set the max memory Chrome can use, we can adapt base on the VM capabilities.
Hi,
I see you are attempting to restrict the container memory by using -m 4G (--memory) option.
From the output of top I can see you have few chrome threads, using not much physical memory (see the MEM column) but a lot of shared memory (see the VIRT column).
My guess here is, it is using a lot of swapped memory (you can inspect also your host with free -h to check what is available vs used)
So, you may want to limit also the swap usage for your container by using in addition the --memory-swap="" option.
See: https://docs.docker.com/engine/reference/run/#user-memory-constraints
Also, I noticed you are running your container as root user, not sure how good is that …
As for limiting the JVM usage … I think it is possible also by tweaking a certain file (not sure if KRE has a katalon.ini, I must check) but I doubt it will help for the current case, since it will limit only the memory for KRE himself but not for the chrome threads.
You may have to build your own docker image using the katalon one as a source and replace the file needed with your own version to achieve that.
The headers that are used to summarize various parameters related to memory are described below:
VIRT (Virtual Memory Size in KiB): Depicts the total amount of virtual memory used by the task. Virtual memory includes all code, data, and shared libraries. It also includes pages that have been swapped out and pages that have been mapped but not used
RES (Resident Memory Size in KiB): Stands for a subset of the virtual memory space ( VIRT ) representing the non-swapped physical memory a task is currently using
SHR (Shared Memory Size in KiB): Stands for a subset of resident memory ( RES ) that may be used by other processes
%CPU (CPU Usage): Stands for the task’s share of the elapsed CPU time since the last screen update, expressed as a percentage of total CPU time. A value greater than 100% can be reported for a multi-threaded process when top is not running in Threads Mode
%MEM (Memory Usage -RES): The task’s current share of available physical memory
Side note: make sure you are also killing and removing the running container in your jenkins pipeline once the test ends.
Leftover containers tend to exhaust a lot of resources usage in time.
Thanks @bionel for these precious information
I am going to try to limit the swap memory and see where it goes.
About running the docker container as root, I know it’s not a good practice. But I run into an error when trying to run it with the current user (Jenkins user). I guess I need to come back on this once the memory problem is solved.
Yes, our Jenkins pipeline is removing all docker container at the end of each run
as far as i know, if you remove the -u root from the pipeline script, inside the container everything should run as a certain katalon user.
but honestly, since i don’t have a license to actually run KRE, my only way to debug such is to read the commit logs and attempt to start the docker container in a controlled environment.