←back to thread

255 points rd07 | 2 comments | | HN request time: 0.411s | source
Show context
BigParm ◴[] No.41298338[source]
How does it occupy 30MB ram but 5MB disk space does it grow
replies(2): >>41298459 #>>41298681 #
1. a-french-anon ◴[] No.41298459[source]

  void *p = malloc(30 * 1024 * 1024);
replies(1): >>41420245 #
2. BigParm ◴[] No.41420245[source]
Makes sense. It's intuitive when you specify a number of bytes. I have myself been allocating memory using "new" so idk how my broken brain asked such a dumbass question.