JavaScript memory overflow, memory leak
Table of Contents
Memory
Memory (Memory) It’s one of the most important parts of a computer , Also called memory and main memory , It’s for temporary storage CPU Operation data in , Data exchanged with external storage such as hard disk . It is external storage and CPU Bridge for communication , All programs in the computer run in memory , Memory performance affects the overall level of computer play . As soon as the computer starts running , The operating system will transfer the data to be calculated from memory CPU In the process of operation , When the operation is complete ,CPU Send the results out .
out of memory
out of memory : An error in the operation of a program . When the program needs more memory to run than the remaining memory , Will throw a memory overflow error .
When we define a variable , The program will give him the corresponding memory . Of course, the memory allocated by the program is limited by , When we keep adding data to variables , Will exceed this limit . Then the program will crash , We call this process to result memory overflow
Memory leak
Memory leak : The occupied memory is not released in time , If memory leaks accumulate too much, it will easily lead to memory overflow .
When we define a global variable , The system will allocate memory to this variable , However, this variable , Has occupied a block of space , Didn’t give up territory , We call this a memory leak
Read more here: Source link