A database transaction is a single unit of work. It is a set of operations that succeed or fail as a unit. Properties of a Transaction Every transaction must have the four properties known as ACID. Atomicity : All operations succeed or fail as a unit. Consistency : Any transaction must end with consistent state… Continue reading Database Transaction Basics using Java
Often in the hurly-burly of projects we forget the basic principles of subjects like Object Oriented Programming. Here I try to capture some of the basic ideas behind the OOPs paradigm and hope it is useful for all.
Find the duplicates in an array in O(n) time There is actually no algorithm to give perfect O(n) time for processing. However, there is a way to find the solution in worst case scenario of O(2n) i.e O(n). ke’s comment about the complexity being O(n2) is indeed correct. You can read more about it at… Continue reading Interesting Algorithm Questions for interview
It is important that before we do any type of JVM tuning, we should throughly profile our system. Memory leaks caused by our application code cannot be fixed by jvm tuning. Java memory is divided into two main parts: 1. Heap size = (Young Gen, Tenured Gen,Permanent Gen) 2. Stack Size allocated to each thread.… Continue reading JVM Tuning
Why is JVM tuning important? For simple uni-processor based Java applications the JVM default tuning parameters are sufficient as the heap size and processes are limited. However, for large systems running on multi-processor systems this may not hold true. With large number of objects and huge heap sizes, the garbage collector may run too slow… Continue reading JVM Tuning Concepts
There are six main memory areas in a JVM: Program Counter Register JVM Stack JVM Heap Method Area Runtime Constant Pool Native Method Stacks
I got this very interesting information regarding memory usage and OutOfMemoryException in servlets and JSP in my mail. The information comes from a very old mail thread archive hosted at mail-archive.com. It is really amazing that this ancient mail thread is still relevant after so many years.