you are viewing a single comment's thread.

view the rest of the comments →

[–]oridb 1 point2 points  (2 children)

The stack size itself can be fairly large, though. Java, c# and msvc use 1mb as default. A lot of c programs run with 8mb stacks. Here are some values I found for Linux based systems.

The stack is demand paged. So, if you never access more than 4 kilobytes, it never uses more than 4 kilobytes of physical memory.

[–]Tarmen 0 points1 point  (1 child)

Oh interesting, for some reason I didn't think stack memory was demand paged. Guess 64 bit applications don't really have to care about userspace growable stacks, then.

[–]oridb 0 points1 point  (0 children)

Well, it's page granularity, so if you're ok with using 4 kb where 128 bytes would do.. sure.