summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-03-15 23:30:58 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-03-15 23:30:58 +0800
commit39f76f7867231d7ce7213350ccdeedbd00835bfa (patch)
treee04e128dd3fe683ba773062e21f83db015875c8b
parent64b01299e64d6e777998fa2abe6758d4eab28891 (diff)
downloadpttbbs-39f76f7867231d7ce7213350ccdeedbd00835bfa.tar
pttbbs-39f76f7867231d7ce7213350ccdeedbd00835bfa.tar.gz
pttbbs-39f76f7867231d7ce7213350ccdeedbd00835bfa.tar.bz2
pttbbs-39f76f7867231d7ce7213350ccdeedbd00835bfa.tar.lz
pttbbs-39f76f7867231d7ce7213350ccdeedbd00835bfa.tar.xz
pttbbs-39f76f7867231d7ce7213350ccdeedbd00835bfa.tar.zst
pttbbs-39f76f7867231d7ce7213350ccdeedbd00835bfa.zip
show sbrk, idrss, isrss
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk@698 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/mbbsd/cal.c8
-rw-r--r--pttbbs/mbbsd/io.c11
2 files changed, 14 insertions, 5 deletions
diff --git a/pttbbs/mbbsd/cal.c b/pttbbs/mbbsd/cal.c
index 71091fac..83e56465 100644
--- a/pttbbs/mbbsd/cal.c
+++ b/pttbbs/mbbsd/cal.c
@@ -1,4 +1,4 @@
-/* $Id: cal.c,v 1.24 2003/03/15 12:33:00 in2 Exp $ */
+/* $Id: cal.c,v 1.25 2003/03/15 15:30:58 in2 Exp $ */
#include "bbs.h"
/* 防堵 Multi play */
@@ -433,7 +433,11 @@ p_sysinfo(void)
#endif
COMPILE_TIME, ctime(&start_time));
if (HAS_PERM(PERM_SYSOP)) {
- prints("記憶體使用量: %d\n", ((int)sbrk(0) - 0x8048000) / 1024);
+ struct rusage ru;
+ getrusage(RUSAGE_SELF, &ru);
+ prints("記憶體用量: sbrk: %d KB, idrss: %d KB, isrss: %d KB\n",
+ ((int)sbrk(0) - 0x8048000) / 1024,
+ (int)ru.ru_idrss, (int)ru.ru_isrss);
#ifdef CRITICAL_MEMORY
prints("目前在 CRITICAL_MEMORY 模式下\n");
#endif
diff --git a/pttbbs/mbbsd/io.c b/pttbbs/mbbsd/io.c
index 1629f7cb..3e8f79a7 100644
--- a/pttbbs/mbbsd/io.c
+++ b/pttbbs/mbbsd/io.c
@@ -1,4 +1,4 @@
-/* $Id: io.c,v 1.27 2003/01/19 13:24:14 kcwu Exp $ */
+/* $Id: io.c,v 1.28 2003/03/15 15:30:58 in2 Exp $ */
#include "bbs.h"
#if defined(linux)
@@ -155,8 +155,13 @@ igetch()
while ((ch = dogetch())) {
switch (ch) {
#ifdef DEBUG
- case Ctrl('Q'):
- vmsg("memory usage: %d KB", ((int)sbrk(0) - 0x8048000) / 1024);
+ case Ctrl('Q'):{
+ struct rusage ru;
+ getrusage(RUSAGE_SELF, &ru);
+ vmsg("sbrk: %d KB, idrss: %d KB, isrss: %d KB",
+ ((int)sbrk(0) - 0x8048000) / 1024,
+ (int)ru.ru_idrss, (int)ru.ru_isrss);
+ }
continue;
#endif
case Ctrl('L'):