virtual memory talk

hol up

Tfw vm.swappiness=95

virt is just what it malloced, but is free to lie to it it gave the mem, till the process actually writes to those pages’ addresses

so idk wtf is swappiness about here

It determines the amount of page file you use. Isn’t virt stored in page file ?

page file is windows

1 Like

Swap partition then .

no, virtual memory is about lying to process about how much memory they have and what address space they see.

while you can swap pages out to a swap{file,partition} it’s not a requirement for virtual memory to do so

1 Like

@Heimdallr say I

uint8_t* mem = malloc(int_pow(2, 32));

the virt would say 4GBs, but since I never touched that mem yet, no pages were actually mapped to real memory

2 Likes

C++ makes this even more fun as it doesn’t release things in the background…

std::vector::clear() doesn’t re-size/release its buffer for instance.

2 Likes

ehm, give me sec.

actually testing what I said lol.


@Heimdallr

image

see the 2K in virt?

image

now it’s 4000M aka 4G but the residential (res, or actually resident on RAM) memory stays the same, even if I make some pages dirty in it


sry for off topic

1 Like

memset(mem,0,int_pow(2,32));

Problem solved… lol

2 Likes

yeah all those dirty dirty pages

because fuck your cache with AVX instructions…

It’s actually surprising how effective gcc has gotten with optimizing memcpy() and the like…

1 Like

image

why the fuck my linux is configured to let processes have no limit on resident set lol

ah nvm, it’s locked memory

65K seems small tho…

ehm hold on

can we keep it focused here?

1 Like

this is what I am doing atm

pending move

FREEDO… (OOM KILLER KILLED PID 478393)

serious talk though… unless you set “huge pages” you can oversubscribe memory.

1 Like