- 论坛徽章:
- 0
|
最近有时间开始写点小程序,昨晚开夜车晕了,一条代码搞错本来112034个utf-8字符的vector,搞成了+1+2+3...+112034这样子
./temp //运行大约15秒还以为无限循环了之后系统反应慢,Ctrl+c按了好多次没反应,然后出现了下面那行终止信息
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
^C^C^C //又按了好多次Ctrl+c还按了回车,硬盘疯响,以为系统要崩,人也精神了,脑子多转了几圈明白怎么回事了
^C^C^C
^C^C
^C^C^C^C
Abort (core dumped) //最后吐core完毕
用开着的filezilla一看3078770688字节这么大,2=3078770688/1024/1024/1024,足足2GB
系统速度恢复,真强壮啊~~
事后想想,巩固了一些基础知识32位寻址空间有4G大,其中的一半对程序可见,这个程序应该还没完全到达2G的顶部,但是很接近了~~
系统:freebsd 7.1r p2
硬件:1G内存,赛扬420,够烂的还集成显卡分掉一些内存
环境:当时开着以下程序~~
PID TT STAT TIME COMMAND
754 v0 IWs+ 0:00.00 /usr/libexec/getty Pc ttyv0
755 v1 IWs 0:00.00 login [pam] (login)
762 v1 IW 0:00.00 -csh (csh)
833 v1 IW+ 0:00.00 /bin/sh /usr/local/bin/startx
851 v1 IW+ 0:00.00 xinit /root/.xinitrc -- /usr/local/bin/X :0 -auth /ro
852 v1 S 742:07.57 /usr/local/bin/X :0 -auth /root/.serverauth.833 (Xorg
857 v1 S 0:25.32 /usr/local/bin/twm
861 v1 S 258:42.92 /usr/local/bin/gkrellm
887 v1 IW 0:00.00 dbus-launch --autolaunch a9f532ab039972478181c8034990
887 v1 IW 0:00.00 dbus-launch --autolaunch a9f532ab039972478181c8034990
1842 v1 S 0:11.26 /usr/local/bin/xterm
6158 v1 S 1:01.88 /usr/local/bin/xterm
38986 v1 R 2:56.04 /usr/local/bin/xterm
93428 v1 IW 0:00.00 /bin/sh /usr/local/bin/firefox3
93432 v1 IW 0:00.00 /bin/sh /usr/local/lib/firefox3/run-mozilla.sh /usr/l
93437 v1 I 11:12.18 /usr/local/lib/firefox3/firefox-bin
756 v2 IWs 0:00.00 login [pam] (login)
867 v2 IW+ 0:00.00 -csh (csh)
757 v3 IWs 0:00.00 login [pam] (login)
58135 v3 IW+ 0:00.00 -csh (csh)
758 v4 IWs+ 0:00.00 /usr/libexec/getty Pc ttyv4
759 v5 IWs+ 0:00.00 /usr/libexec/getty Pc ttyv5
760 v6 IWs+ 0:00.00 /usr/libexec/getty Pc ttyv6
761 v7 IWs+ 0:00.00 /usr/libexec/getty Pc ttyv7
902 p0- S 2:19.03 fcitx
1845 p0 Is+ 0:01.12 csh
35740 p0 I 3:02.84 filezilla
6161 p1 IWs+ 0:00.00 csh
39039 p3 Ss 0:00.77 csh
71065 p3 S 4:32.74 gedit
83328 p3 S 0:05.93 ghex2
93871 p3 R+ 0:00.00 ps |
|