Bug 754761 - rpm/yum taking a long time when system under memory stress
Summary: rpm/yum taking a long time when system under memory stress
Keywords:
Status: CLOSED DUPLICATE of bug 752897
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: 16
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Panu Matilainen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-11-17 16:34 UTC by Hin-Tak Leung
Modified: 2011-11-20 18:58 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-11-20 18:58:23 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Hin-Tak Leung 2011-11-17 16:34:16 UTC
Description of problem:
I have noticed this problem in f15 with yum, but it seems to have spreaded to rpm itself. When I have a lot of browser tabs/windows open i.e. system using a lot of memory, but most of it can be swap out and should be - rpm/yum takes a long time, and system doing a lot of swapping meanwhile. (whereas the browser-usage-alone would be mostly idle and not swapping with a substantial part of it swap out). 



Version-Release number of selected component (if applicable):
rpm-4.9.1.2-1.fc16.x86_64

How reproducible:
Always


Steps to Reproduce:
1. open a fair number of browser windows, on a system configured with both real and virtual memory.
2. try to run rpm -Uvh on a small package
3.
  
Actual results:
System swaps a lot (for hours), while eventually succeeds, or I would get impatient with constant swapping and shutdown the browser (with session restore) to allow yum/rpm to finish quickly.

Expected results:
rpm should try to either push swap-out-able processes entirely to proceed quickly, or abort with an appropriate message e.g. 'can't allocate memory ATM, try later or when system less loaded'.

Additional info:
I understand that this behavioe may be a design decision (e.g. rpm must get "real" memory rather than virtual ones for integrity), but this probably should be documented.

I just tried gdb attaching to the 'taking-ages' 'rpm -Uvh' process, and this is the backtrace:

-----------------
(gdb) bt
#0  0x000000310cb1e7fe in __memp_alloc () from /lib64/libdb-4.8.so
#1  0x000000310cb2182d in __memp_fget () from /lib64/libdb-4.8.so
#2  0x000000310cae871d in __db_goff () from /lib64/libdb-4.8.so
#3  0x000000310cad52e7 in __dbc_iget () from /lib64/libdb-4.8.so
#4  0x000000310cae063d in __dbc_get_pp () from /lib64/libdb-4.8.so
#5  0x00000030fe013673 in ?? () from /usr/lib64/librpm.so.2
#6  0x00000030fe01cb86 in rpmdbNextIterator () from /usr/lib64/librpm.so.2
#7  0x00000030fe044a82 in ?? () from /usr/lib64/librpm.so.2
#8  0x00000030fe045f8a in rpmtsRun () from /usr/lib64/librpm.so.2
#9  0x00000030fe0391b5 in ?? () from /usr/lib64/librpm.so.2
#10 0x00000030fe03a9e6 in rpmInstall () from /usr/lib64/librpm.so.2
#11 0x00000000004016ef in ?? ()
#12 0x00000030fb42169d in __libc_start_main () from /lib64/libc.so.6
#13 0x0000000000401bd1 in ?? ()
#14 0x00007fff168ebc58 in ?? ()
#15 0x000000000000001c in ?? ()
#16 0x0000000000000003 in ?? ()
#17 0x00007fff168edefc in ?? ()
#18 0x00007fff168edf00 in ?? ()
#19 0x00007fff168edf05 in ?? ()
#20 0x0000000000000000 in ?? ()
(gdb) q
-------------------

So it seems to be trying to get memory but very slowly. I think it should either do it quickly (pushing swap-out-able processes out quickly) or abort with an appropriate message, rather than taking ages.

Comment 1 Panu Matilainen 2011-11-18 06:32:24 UTC
This is probably dupe of bug 752897. See if the workaround there (in comment 12) helps.

Comment 2 Hin-Tak Leung 2011-11-20 18:58:23 UTC
(In reply to comment #1)
> This is probably dupe of bug 752897. See if the workaround there (in comment
> 12) helps.

Made the change and is happy(?..) to say it is probably the same thing.

*** This bug has been marked as a duplicate of bug 752897 ***


Note You need to log in before you can comment on or make changes to this bug.