What is the counting of links?

Reference counting is a computer programming technique used to streamline memory management, which allows the computer to know immediately when it is "safe" to release a specific value or block of values ​​from memory. In programming, the economy is essential, so programs can be carried out on the widest possible range of computer hardware. Memory with random access (RAM) is an important but final source for the computer. Storage of program data stored in RAM is one of the fastest ways to improve the program response time, but consumption of too many RAM systems makes a source pig, an undesirable feature from the end user's point of view. The reference to the counting operates to balance it by keeping data in RAM if needed in the program. Think about computer memories as a children's room full of toys and storage space on your hard disk as a chest toysty. Counting references monitors specific "toys" (objects) program (child) plays at any time; In other words, the number of objects thatThey are currently on the "floor". As soon as the program stops playing with a particular object, counting links acknowledges and sends the object back to the storage on the hard drive rather than allowing it to continue consuming the space in the RAM.

In terms of advantages, the primary advantage of counting references comes from immediacy. The moment the program ends with the object, it puts it away, releases space for other objects in the program and for other programs on the computer. From the end of the end user, this is a very clean approach; The program never takes more memory than it requires in any specific time.

The disadvantage of this technique is the economy. In order to calculate links to operates, eternal monitoring equipment must be used to manage the number of objects used at the same time. This consumes a small part of the CPU memory and capacity and increases the processor direction from the program. As a result, the decision to use reference countingbecomes an equalizing act and determines whether the programmer wants to allocate further stress CPU or RAM.

IN OTHER LANGUAGES

Was this article helpful? Thanks for the feedback Thanks for the feedback

How can we help? How can we help?