0

I've noticed that, in ubuntu 12.04 x64, all programs map stack segment to virtual address range like:

7fff0f59b000-7fff0f5bc000 rw-p 00000000 00:00 0      [stack]

Since 0xbc000 - 0x9b000 = 0x21000 = 135168, the size is much smaller than the value given by ulimit -s (8192KB)

Could you tell me why? Will stack segment grow automatically up to 8MB limit? Thank you in advance.

ShenLei
  • 567
  • 1
  • 5
  • 17

1 Answers1

1

I found the reason. ulimit -s is just upper limit, not initial committed virtual memory for stack. It will grow. But I sill don't know how to achieve that. Just "sub rsp, size; mov [rsp], imm" does not work.

ShenLei
  • 567
  • 1
  • 5
  • 17