今天发现一个接入交换机Catalyst3550无法保存配置,经查确认是SSH2导致memory leak。查找问题原因的过程如下:。
1、利用show run命令无法显示,并无法保存配置,输入copy run start命令时的提示信息如下:。
copy running-config startup-config
Destination filename [startup-config]?
%No memory available: Update of NVRAM config failed!
2、查看系统日志,有如下提示信息:
Aug 10 11:28:12: %SYS-2-MALLOCFAIL: Memory allocation of 393216 bytes failed from 0x8E6CE8, alignment 0
Pool: Processor Free: 126856 Cause: Not enough free memory
Alternate Pool: None Free: 0 Cause: No Alternate pool
-Process= "Virtual Exec", ipl= 0, pid= 124
-Traceback= 8E0CDC 8E13F0 F7CB80 F85A34 127A1E0 8E6CEC 8E6C9C 895628 D513BC A56F08 86DA88 8994D8 3F4EB0 3EBBC0
3、查看系统内存信息,显示Free仅123888:
sh processes memory
Processor Pool Total: 36792608 Used: 36668720 Free: 123888
I/O Pool Total: 8388608 Used: 3022672 Free: 5365936
PID TTY Allocated Freed Holding Getbufs Retbufs Process
0 0 29909284 8841212 17536844 0 0 *Init*
0 0 13532 707187096 13532 0 0 *Sched*
0 0 1718077516 1798032968 18601756 3242016 54540 *Dead*
从上信息也可以看出Dead占用了较多内存,远远超出1M,是不正常的。
4、采用下列命令查看内存分配情况,很明显SSH2的Count值达216144,不正常。
sh memory allocating-process totals
Head Total(b) Used(b) Free(b) Lowest(b) Largest(b)
Processor 1D26EE0 36792608 36673052 119556 48892 49832
I/O 80000000 8388608 3049708 5338900 5160304 5149232
Allocator PC Summary for: Processor
PC Total Count Name
0x01244BD4 17873500 216144 SSH2 String
0x009386B0 4882056 6 Init
0x001583A0 1643004 1793 *Packet Header*
0x003E9F84 1274304 166 Interrupt Stack
0x00402794 441936 44 Flashfs Sector
0x00EA3DAC 393480 6 STP Port Control Block Chunk
0x00165910 323544 102 *Hardware IDB*
0x0098EC9C 262232 2 CEF: hash table
0x00F6A7F0 246420 15 TW Buckets
0x0025FFE4 245604 97 PM port sub-block
5、进而采用sh mem dead 命令,由此可看出是由SSH2 String导致内存dead.
sh memory dead
Head Total(b) Used(b) Free(b) Lowest(b) Largest(b)
Processor 1D26EE0 36792608 36675296 117312 48892 49832
I/O 80000000 8388608 3049708 5338900 5160304 5149232
Processor memory
Address Bytes Prev Next Ref PrevF NextF Alloc PC what
01D36F0C 0000000024 01D26EE0 01D36F50 001 -------- -------- 01244BD4 SSH2 String
01D36F50 0000000056 01D36F0C 01D36FB4 001 -------- -------- 01244BD4 SSH2 String
01D36FB4 0000000032 01D36F50 01D37000 001 -------- -------- 01244BD4 SSH2 String
01D37000 0000000032 01D36FB4 01D3704C 001 -------- -------- 01244BD4 SSH2 String
通过上述命令查看,可以得出是由于SSH2导致memory leak,应该属于软件Bug,目前所使用的软件版本为:c3550-
ipservicesk9-mz.122-44.SE2.bin。看来得更换一个软件版本了。