your program will have to die before the memory is reclaimed you stupid Black person
it's like asking why you should clean your own room when it won't matter after you blow your brains out
your program will have to die before the memory is reclaimed you stupid Black person
it's like asking why you should clean your own room when it won't matter after you blow your brains out
- OS may not reclaim memory on process exit (on modern OSes, happens with shared memory)
- if it does, then it's still memory that could have been used for something else
- you may run out of memory before execution completes, and the OS will kill your process
- it may keep the pages mapped in process memory, making future allocations faster
- in multithreaded environments, concurrent allocation and de-allocation operations can be optimized to complete faster
The OS won't reclaim the memory until after the program is done with it, which happens when it's freed or when the program exists.
The OS, compiler or anything else can't compensate for shit code.
You shouldn't. Programs run faster with allocate&forget (given you exit early enough).
It's also a good reason to use GC; you get the speedup but the program doesn't crash horribly if memory runs out.
It's a good practice.
Not five reasons
>black bullets
why?
whyte wimminz love da big black cartridge
>when the OS will reclaim the memory anyways
via the OOM killer? I think your admins will kill you first.
NYPA.
americans really love gun violence eh
Not freeing is a viable strategy for short lived processes. This is often actually done e.g. in compilers.
Sounds more like your compiler is shit.
I see memory leaks when I run gcc through valgrind
show screenshot of supposed memory leaks
your program will have to die before the memory is reclaimed you stupid Black person
it's like asking why you should clean your own room when it won't matter after you blow your brains out
- OS may not reclaim memory on process exit (on modern OSes, happens with shared memory)
- if it does, then it's still memory that could have been used for something else
- you may run out of memory before execution completes, and the OS will kill your process
- it may keep the pages mapped in process memory, making future allocations faster
- in multithreaded environments, concurrent allocation and de-allocation operations can be optimized to complete faster
Can I eat the remains?
Here you go, moron.
https://en.m.wikipedia.org/wiki/Memory_leak#Consequences
https://en.m.wikipedia.org/wiki/Memory_leak#Effects
Just never free(). See what happens. Remember to mention "btw I never free()" in CV and during interviews. Remove yourself from the workforce.
it's okay, bro, just run this code
Frick i forgot the pic
>five reasons
imposible, anyway...
good pratice
you can develop a bad habit if not used
crashes on atexit
[filler space]
bad for shared resources
Viruses can steal ur bits
The OS won't reclaim the memory until after the program is done with it, which happens when it's freed or when the program exists.
The OS, compiler or anything else can't compensate for shit code.
You shouldn't. Programs run faster with allocate&forget (given you exit early enough).
It's also a good reason to use GC; you get the speedup but the program doesn't crash horribly if memory runs out.