Bug 120943

Summary: kscd eats lots of memory
Product: [openSUSE] SUSE LINUX 10.0 Reporter: Olaf Kirch <okir>
Component: KDEAssignee: E-mail List <kde-maintainers>
Status: RESOLVED WORKSFORME QA Contact: E-mail List <qa-bugs>
Severity: Major    
Priority: P5 - None    
Version: RC 4   
Target Milestone: ---   
Hardware: x86-64   
OS: All   
Whiteboard:
Found By: Development Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: strace (I left it running for a while)

Description Olaf Kirch 2005-10-07 07:46:09 UTC
After starting kscd, I noticed that my system got a little sluggish  
every now and then (even with no CD in the drive).  
  
I watched the system with top and noticed that kcsd's resident memory  
size would sometimes jump to almost 1GB of memory. It seems it mmaps 
a 1G region and walks all over it, then releases it. 
 
I'm attaching an strace of kscd demonstrating the problem.
Comment 1 Olaf Kirch 2005-10-07 07:48:37 UTC
Created attachment 51749 [details]
strace (I left it running for a while)

The relevant bit are the frequent mmap/munmap calls:

mmap(NULL, 1023414272, PROT_READ|PROT_WRITE,
		MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
...
munmap(0x2aaaafa00000, 1023414272)

I hope the KDE folks can tell me why it's doing this.
Comment 2 Stephan Kulow 2005-10-07 08:14:13 UTC
hmm, there is no mmap call in the kscd code from what grep tells me. Am I free 
to blame glibc here? :) 
Comment 3 Lubos Lunak 2005-10-07 09:12:24 UTC
Probably not. The mmap() may come from malloc(). 
 
Comment 4 Dirk Mueller 2005-10-07 09:27:57 UTC
its most likely a malloc because its an anon mmap. anyway, this is probably  
x86_64 specific, and I don't have such a computer available for testing.   
  
Olaf, please set ulimit -v 300000, install debuginfo packages, wait till kscd  
crashes and attach the backtrace please.   
  
<insert standard rambling about missing ulimits on a default suse 
installation> 
Comment 5 Stephan Kulow 2006-05-07 11:35:06 UTC
we were unable to reproduce