Home Е-Mail
Home | E-Mail
Addition

Advertising

Automatic control of memory

Java uses an automatic garbage collector to control memory in lifecycle object. The programmer defines, when objects are created, and execution time of Java responsibly for memory restoring as soon as objects are not any more in usage. As soon as any links to the object do not remain, the inaccessible object becomes the garbage collector released automatically. Memory leaks can still occur, if the code of the programmer holds the link to the object which is not necessary any more, is typical when objects which are not necessary any more, are stored in containers which are still in usage.



One of ideas of automatic model of a memory management of Java - that programmers have eliminated necessities to fulfil manual operation by memory. By responsibility of supervising memory is united by any with the programmer. If the program does not release the object, the memory leak occurs. If the program tries to get access or to release memory which has been already released, the result is indefinite, and the program can become nonconstant and-or can fail. It can be partially corrected by means of clever pointers, but it adds special complexity to usage.


Garbage collections allow to happen at any time. Ideally, it will occur, when the program will be loaf. As manufacturers guarantee, it also will occur, if there is an insufficient free memory on a heap to assign the new object which can force to stop the program for an instant.


Java does not support C/C ++ arithmetics of the pointer of style, in which addresses of the object and integers (usually number long-integers) can be used alternately. It should allow to a garbage collector to move objects to which refer, and to guarantee safety.


As in C ++ and some other languages oriented to the object, variables of primitive types of Java are oriented to objects. Values of primitive types or are saved directly in areas (for objects,) or on a stack (for methods), instead of on a heap, as the common case for objects. It was conscious solution of designers of Java for the job reasons. Because of it Java as believed, was not the pure programming language oriented to the object. However, in Java 5.0 autoboxing allows programmers to write, as though primitive types - the classes of a wrapper, with their copies oriented to the object representing own classes, and freely to exchange between them for the improved flexibility.

buy chesterfield cigarettes legal - buy Viagra Super Active levitra alternative lavitra. - adultfrendfinder.com members love to show off in front of their webcams.
© 2008 by Stas_oN. All Rights Reserved