What is the overflow of the magazine?

The tank overflow is a programming error in which the attempt to write data in a specific memory block fails because there is no space left in the block. This type of error occurs in the same way as overflowing of the buffer, overflowing of the heap and overflowing of the reservoir buffer. The difference between these types of errors depends on the computer data structure used and the common feature is that it is available to try to write more data than available. In C ++, overflowing of the magazine is often manifested as a segmentation error, and there are often no other information to determine where and how overflows. Overflow in Java often leads to a virtual machine crash that gives out a reasonably detailed set of errors. Regardless of the language in which overflows, overflows can almost always be correctly repaired and identifying the original overflow source.

Computer languages ​​that offer ExpMemory management is often easier to protect against overflowing the magazine. The widely accepted programming practice usually dictates that the program should also be deleted for each memory segment. C ++ allows this mechanism and careful monitoring in this way can maintain the amount of memory that the program uses to a minimum. Languages ​​that do not offer explicit memory management and instead use memory -management, it is more difficult to protect against the error overflow. Java processes its own memory on its virtual computer, so the data cannot be explicitly deleted at will to create space for more.

The common error of beginning programmers is to assume that in computer languages ​​that process their own memory management, the stack cannot overflow. Although it seems to be plausible. Languages ​​with Memory Implication often have garbage collectors that free unnecessary memory blocks but these collectorsDKs do not always work at a time when the programmer expects. The reliance on garbage collectors is relatively dangerous and cannot always protect the program from overflow error.

overflow errors can be cataclysmatic and stop the whole program, or there may be almost silence and allow the program to continue. These second types of errors are often the hardest to find because there may be an error that came from overflowing many lines of code earlier. The overflow of the magazine often does not require searching for the entire program, but the longer the program can run after overflow, the more difficult it can be to find and fix the error.

IN OTHER LANGUAGES

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

How can we help? How can we help?