Jenkins consumes a very large portion of physical memory - memory-management

I have installed Jenkins on a virtual OS. Whenever I start the Jenkins service the physical memory goes up to 94%. Then it never reduces. So my system becomes very slow and unresponsive. As a result the Jenkins web page becomes slow. I have allocated 4GB for RAM. Is there any way to speed up my machine to restrict the memory use for Jenkins?

Related

Stressing the memory of linux server

I used the stress command to stress the CPU of the Linux server(CentOS). Following is the command used.
sudo stress --cpu 4 --timeout 3600
Also I want to do the stress test for the Server memory using such a bash command. The answer here is not supported with bash commands. I am aware of the tools that can be used to stress the memory as stated here. But I want to write a bash script to do stressing.
Does memory stressing affect for virtual memory or only physical memory?
Virtual memory is when some disk space is allocated for this to be more RAM, but would be slower as you are using the hard drive. I would not stress test the virtual memory, if you cannot stop a stress test using the virtual memory, then i would disable virtual memory temporarily, and then after your stress test on the RAM, you can enable the virtual memory again.

How much benefit is there to running 64-bit instead of 32-bit application on Windows, assuming the application is bottlenecked by RAM?

I have some conceptions I will lay out first. A 32-bit Windows application can't address more than ~3 GB of memory if I got it right. However, when it runs out of memory in its virtual address space, it will hand over data to the Windows virtual memory manager in order to make more space for whatever it needs. Windows' virtual memory manager will then write this data to a location that is in physical RAM, but outside the application's virtual address space. When the 32-bit application needs this data again, the virtual memory manager can respond swiftly by loading it from physical RAM.
I can imagine there is overhead to this. How much overhead are we talking about? A 64-bit application would be able to make a virtual address space that is large enough for everything it needs, but how much more efficient is this than shuffling around data with the memory manager?

How can a 4GB process run on only 2 GB RAM?

Given a 32-bit/64-bit processor can a 4GB process run on 2GB RAM. Will it use virtual memory or it wont run at all?
This is HIGHLY platform dependent. On many 32bit OS's, no single process can ever use more than 2GB of memory, regardless of the physical memory installed or virtual memory allocated.
For example, my work computers use 32bit Linux with PAE (Physical Address Extensions) to allow it to have 16GB of RAM installed. The 2GB per process limit still applies however. Having the extra RAM simply allows me to have more individual processes running. 32bit Windows is the same way.
64bit OS's are more of a mixed bag. 64bit Linux will allow individual processes to map memory well in excess of 32GB (but again, varies from Kernel to Kernel). You will be limited only by the amount of Swap (Linux virtual memory) you have. 64bit Windows is a complete crap shoot. Certain versions will only allow 2GB per process, but most will allow >32GB limited only by the amount of Page File the user has allocated.
Microsoft provides a useful table breaking down the various memory limits on various OS versions/editions. Unfortunately there is no such table that I can find with cursory searching for Linux since it is so fragmented.
Short answer: Depends on the system.
Most 32-bit systems have a limitation of 2GB per process. If your system allows >2GB per process, then we can move on to the next part of your question.
Most modern systems use Virtual Memory. Yet, there are some constrained (and various old) systems that would just run out of space and make you cry. I believe uClinux supports both MMU and MMU-less architectures. Most 32-bit processors have a MMU (a few don't, see ARM Cortex-M0) and a handful of 16-bit or 8-bit have it as well (see Atmel ATtiny13A-MMU and Atari MMU).
Any process that needs more memory than is physically available will require a form of Memory Swap (e.g., a partition or file).
Virtual Memory is divided in pages. At some point, a page reside either in RAM or in Swap. Any attempt to access a memory page that's not loaded in RAM will trigger an interruption called Page Fault, which is handled by the kernel.
A 64-bit process needing 4GB on a 64-bit OS can generally run in 2GB of physical RAM, by using virtual memory, assuming disk swap space is available, but performance will be severely impacted if all of that memory is frequently accessed.
A 32-bit process can't address exactly 4GB of memory in practice (some address space overhead is required by the operating system), so it won't run. Depending on the OS, it can probably run a process that needs > 2GB and < 3-4GB.

It is possible to slow down the virtual pc machine in Win7 (by reduce CPU etc.)

I am trying to get a slow machine with IE8 to test for some customers. It is possible to slow down the virtual pc machine provided by MS? I did only find how to reduce RAM but not CPU.
In options, you can choose to divide CPU time equally among all VPC instances, versus runing the active VPC at maximum speed.
No, this is not possible due to the way virtual machines work. As the virtual machines runs directly on the processor, you cannot slow that down. Your only option is to run on a virtual machine that does processor emulation.
VirtualBox from Oracle does what you want. In the main interface, click Settings > System > Processor and set the Execution Cap to (say) 50%. Works nicely, except that the entire VM slows down (not just a specific application like IE).

Does JVM memory management work the same on Windows and Linux?

My original question is that, is this technically rational to check the required heap-size of my Java program on Windows 7, via VisualVM, and come to this conclusion that the program will require the same amount of heap on Linux(RedHat) as well?
I don't know how the system(OS or even CPU and RAM), affect memory management of JVM.
well, the windows is my development system with 4GB of RAM and a Core 2 Due CPU, however the
Linux is the production system with 32GB of RAM and multiple powerfull processors,
Actually, my concern is that the program on Linux might need more memory. less is ok.

Resources