Give me five reasons why I should free() when the OS will reclaim the memory anyways or I kill this anime blob

Give me five reasons why I should free() when the OS will reclaim the memory anyways or I kill this anime blob.

Attached: 1644510806548.jpg (850x727, 307.59K)

Other urls found in this thread:

en.m.wikipedia.org/wiki/Memory_leak#Consequences
en.m.wikipedia.org/wiki/Memory_leak#Effects
twitter.com/NSFWRedditGif

It's a good practice.

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.

your program will have to die before the memory is reclaimed you stupid nigger
it's like asking why you should clean your own room when it won't matter after you blow your brains out

Sounds more like your compiler is shit.

Not five reasons

Attached: 1655928801193.gif (498x331, 2.08M)

- 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?

Attached: tumblr_642d922e4b9bde9faab1fb4ebfbeb6f0_d3555192_640.png (540x540, 277.71K)

Here you go, retard.

en.m.wikipedia.org/wiki/Memory_leak#Consequences

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.

Rust doesn't have this problem.

it's okay, bro, just run this code

Fuck i forgot the pic

Attached: photo_2022-07-09_17-39-22.jpg (367x214, 10.11K)

>five reasons
imposible, anyway...

good pratice
you can develop a bad habit if not used
crashes on atexit
[filler space]
bad for shared resources

I see memory leaks when I run gcc through valgrind

>black bullets
why?

whyte wimminz love da big black cartridge

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.

>gcc
>not shit
LMAOing at you