How the java VM protect it's memory?

The JVM doesn't do much checking; it's the OS that generates bus errors (mis-aligned memory references) or segmentation violations (out-of-process space memory references). It's the compiler that did most of the work, i.e. it checks whether or not the code is correct; it can't check bounds references, nor down casts so that is the job of the JVM, as well as division by zero and then some. It's a delicate balance: the JVM 'trusts' the compiler and the compiler 'trusts' the JVM to be correct. On top of that the content of a class file is checked when loaded.

Enter your email address to get our daily JOBS & INTERVIEW FAQ's Straight to your Inbox.

Make sure to activate your subscription by clicking on the activation link sent to your email