Get memory overflow caused by a memory leak and the application keep running and allocating

前端 未结 2 810
我寻月下人不归
我寻月下人不归 2021-01-27 20:36

I developed a small application for a memory leak stress:

#include 
#include 

int main(int argc, char **argv)
{
    int period =          


        
2条回答
  •  臣服心动
    2021-01-27 21:00

    Crash will happen when you try to use memory after when allocation actually fails. (other reasons include dereferencing wild pointer, trying to access memory that belongs to other process etc.) but if allocation fails due to unavailability of memory, that alone will not result in crash.

提交回复
热议问题