#include   <stdio.h> 
#include   <stdlib.h> 
#include   <sys/time.h> 
#include   <sys/resource.h> 
#include   <unistd.h> 
  
int   main() 

        struct   rlimit   lmt; 
  
        getrlimit(RLIMIT_STACK,&lmt); 
  
        printf( "rlim_cur=%u,rlim_max=%u\n ",lmt.rlim_cur,lmt.rlim_max); 


在我的机器上(Linux   Kernel版本为2.4.18-3)输出结果为: 
rlim_cur=8388608,rlim_max=4294967295 
  
说明当前的堆栈空间为8M,但作为扩展,最大可支持4G(理论值)

相关文章:

  • 2022-12-23
  • 2021-09-21
  • 2021-05-22
  • 2021-08-03
  • 2021-05-17
  • 2022-03-05
猜你喜欢
  • 2021-12-17
  • 2022-12-23
  • 2021-12-29
  • 2021-09-05
  • 2021-04-15
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案