Add information about memory leaks (#18392)

pull/18884/head
zaibugemi 2018-10-14 01:02:36 +05:00 committed by Heather Kusmierz
parent 338d94b517
commit 72fe8fc519
1 changed files with 1 additions and 1 deletions

View File

@ -30,5 +30,5 @@ title: Dynamic Memory Allocation
`delete ptr2`; `delete ptr2`;
### Memory Leaks ### Memory Leaks
Leaks are caused when you fail to deallocate dynamic memory you allocated via `New` operator at the end of your program. If you do not deallocate it with the Delete operator, your computer will keep creating new memory in the heap every time the program runs. This causes your computer to slow down because memory is not deleted and your available memory decreases. Leaks are caused when you fail to deallocate dynamic memory you allocated via `New` operator at the end of your program. If you do not deallocate it with the Delete operator, your computer will keep creating new memory in the heap every time the program runs. This causes your computer to slow down because memory is not deleted and your available memory decreases. Many computer programs cause memory leaks over time. However, when you reboot the machine, it will resolve the issue. This is because rebooting releases those spaces in heap memory that were causing memory leaks.