Chinaunix首页 | 论坛 | 博客
  • 博客访问: 628689
  • 博文数量: 227
  • 博客积分: 8017
  • 博客等级: 中将
  • 技术积分: 2069
  • 用 户 组: 普通用户
  • 注册时间: 2007-12-08 22:50
文章分类

全部博文(227)

文章存档

2011年(10)

2010年(55)

2009年(28)

2008年(134)

我的朋友

分类: LINUX

2008-04-09 21:03:01

1. 可以用ulimit -a 查看一下栈的大小。

在内核2.6.20下, stack size  为8192 kbytes
如果这里没有限制,就栈的大小就只受内存的限制。2G是上限。

2. core 文件
  • 开启或关闭core文件的生成
ulimit -c 可以查看是否打开此选项,若为0则为关闭;
ulimit -c 0可手动关闭
ulimit -c 1000 为设置core文件大小最大为1000k
  • 设置Core Dump的核心转储文件目录和命名规则

/proc/sys/kernel/core_uses_pid可以控制产生的core文件的文件名中是否添加pid作为扩展,如果添加则文件内容为1,否则为0
proc/sys/kernel/core_pattern可以设置格式化的core文件保存位置或文件名,比如原来文件内容是core-%e
可以这样修改:
echo "/corefile/core-%e-%p-%t" > core_pattern
将会控制所产生的core文件会存放到/corefile目录下,产生的文件名为core-命令名-pid-时间戳
以下是参数列表:
    %p - insert pid into filename 添加pid
    %u - insert current uid into filename 添加当前uid
    %g - insert current gid into filename 添加当前gid
    %s - insert signal that caused the coredump into the filename 添加导致产生core的信号
    %t - insert UNIX time that the coredump occurred into filename 添加core文件生成时的unix时间
    %h - insert hostname where the coredump happened into filename 添加主机名
    %e - insert coredumping executable name into filename 添加命令名



阅读(654) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~