How is the default max Java heap size determined?

On Windows, you can use the following command to find out the defaults on the system where your applications runs. java -XX:+PrintFlagsFinal -version | findstr HeapSize Look for the options MaxHeapSize (for -Xmx) and InitialHeapSize for -Xms. On a Unix/Linux system, you can do java -XX:+PrintFlagsFinal -version | grep HeapSize I believe the resulting output … Read more

How to deal with “java.lang.OutOfMemoryError: Java heap space” error?

Ultimately you always have a finite max of heap to use no matter what platform you are running on. In Windows 32 bit this is around 2GB (not specifically heap but total amount of memory per process). It just happens that Java chooses to make the default smaller (presumably so that the programmer can’t create … Read more

Why should C++ programmers minimize use of ‘new’?

There are two widely-used memory allocation techniques: automatic allocation and dynamic allocation. Commonly, there is a corresponding region of memory for each: the stack and the heap. Stack The stack always allocates memory in a sequential fashion. It can do so because it requires you to release the memory in the reverse order (First-In, Last-Out: … Read more

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