Get OS-level system information

You can get some limited memory information from the Runtime class. It really isn’t exactly what you are looking for, but I thought I would provide it for the sake of completeness. Here is a small example. Edit: You can also get disk usage information from the java.io.File class. The disk space usage stuff requires … Read more

How is the java memory pool divided?

Heap memory The heap memory is the runtime data area from which the Java VM allocates memory for all class instances and arrays. The heap may be of a fixed or variable size. The garbage collector is an automatic memory management system that reclaims heap memory for objects. Eden Space: The pool from which memory … Read more

What is memory fragmentation?

Imagine that you have a “large” (32 bytes) expanse of free memory: ———————————- | | ———————————- Now, allocate some of it (5 allocations): ———————————- |aaaabbccccccddeeee | ———————————- Now, free the first four allocations but not the fifth: ———————————- | eeee | ———————————- Now, try to allocate 16 bytes. Oops, I can’t, even though there’s nearly … Read more

Purpose of memory alignment

The memory subsystem on a modern processor is restricted to accessing memory at the granularity and alignment of its word size; this is the case for a number of reasons. Speed Modern processors have multiple levels of cache memory that data must be pulled through; supporting single-byte reads would make the memory subsystem throughput tightly … Read more

How to find out which processes are using swap space in Linux?

The best script I found is on this page : http://northernmost.org/blog/find-out-what-is-using-your-swap/ Here’s one variant of the script and no root needed: #!/bin/bash # Get current swap usage for all running processes # Erik Ljungstrom 27/05/2011 # Modified by Mikko Rantalainen 2012-08-09 # Pipe the output to “sort -nk3” to get sorted output # Modified by … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)