From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040207 Firefox/0.8 Description of problem: I've been using the kernel rpms from http://people.redhat.com/arjanv/2.5/readme.txt. When trying to remove old kernels using rpm, rpm consumes huge (500MB) amounts of memory and never seems to finish the remove. [root@xpc19 root]# rpm -e kernel-2.6.3-2.1.242 from ps: root 1491 18.7 79.5 539048 100756 pts/0 R 16:01 1:11 rpm -e kernel-2.6.3-2.1.242 strace is not very helpful: [...] pread(4, "\0\0\0\0\1\0\0\0-\3\0\0\0\0\0\0\376\4\0\0\306\0\t\2\0\2"..., 4096, 3330048) = 4096 mremap(0xcec75000, 221011968, 221011968, MREMAP_MAYMOVE) = 0xcec75000 mmap2(NULL, 217088, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xe8326000 mremap(0xcec75000, 221011968, 221229056, MREMAP_MAYMOVE) = 0xcec75000 munmap(0xe8326000, 217088) = 0 pread(4, "\0\0\0\0\1\0\0\0.\3\0\0\0\0\0\0S\0\0\0\340\0,\3\0\2\362"..., 4096, 3334144) = 4096 mremap(0xcec75000, 221229056, 221229056, MREMAP_MAYMOVE) = 0xcec75000 mmap2(NULL, 217088, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xe82f1000 mremap(0xcec75000, 221229056, 221442048, MREMAP_MAYMOVE) = 0xcec75000 munmap(0xe82f1000, 217088) = 0 pread(4, I have tried to rebuild the rpm database, but that doesn't help. The machine has 128MB ram and 1GB of swap. Version-Release number of selected component (if applicable): rpm-4.2.1-0.30 How reproducible: Always Steps to Reproduce: 1. Try to remove kernel rpm 2. 3. Additional info:
How many kernels do you have installed? rpm -qa | grep kernel | wc -l
Embarrassingly, 24. This was a case of setting yum to update the 2.6 kernel and forgetting about it!
Time to clean up, I'd say. The duplicate basenames in 24 kernels is causing an algorithm withing rpm to explode. No easy fix.
I had the same problem on FC2 with only three kernels installed, but it was a showstopper because the machine had only 64 MiB RAM. Upgrading to rpm-4.3.2-0.10 solved the problem. The memory usage went down from >120 GiB to around 10 MiB.