LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-26-2007, 04:40 AM   #1
tovis
Member
 
Registered: Jan 2007
Location: Budapest
Distribution: Debian
Posts: 74

Rep: Reputation: 15
buffers and cached groing up to total!?


Recently I have build two small and simple "daemon like" progrz to handle short messages comings from different sources and different channels. One of them stay "listen" on /dev/ttySx, playing some simple protocol, and sends incoming messages through multicast UDP channel, to LAN. Other doing the same task but messages coming from unicast UDP from different LAN ("private" GSM/GPRS APN), here is some what more difficult protocol but no big "wonders". For now, debug/test period I'm using simple bash script to start 3 times the serial "port" and 1 times udp port (stdin and stdout redirected to a log file using bash, stdin simply closed). After each 10 - 20 minutes buffers and cached items got from "free" are increasing about 100K, and after several hours I1m out of memory. When I've stopped all my instances of my progz, memory was not released! Now I'm realized, that my box for testing, on "idle" state - nothing is running, exclude the system and several daemons eating about 4 K of memory in every 5 min!?
Box is a Dell Gn+ with P200MHz MMX, 64 MByte RAM, Debian stable 3.1, kernel 2.6.9 (I need this old release because of the SUNIX serial ports those have kernel patches for this release). No Xwindow, two NIC-s and add-on serial port card (2 ports).
Progz are using "liboop" which are based on "select" for I/O multiplexing, no multithreading.
Any suggestion ... ?
 
Old 01-26-2007, 05:29 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,133

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
Relax, this is the way Linux manages memory. Cached memory is available for immediate re-use by a program should it be needed. If not (needed), the cached data remain there for fast retrieval.
Many threads on this.

The primary issue is "is it causing *you* problems ???.
If (in the unlikely event) it does cause problems, the behaviour can be changed using the swappiness sysctl. Search here on LQ for how to change it.
Shouldn't be needed in normal environments.
 
Old 01-26-2007, 06:24 AM   #3
tovis
Member
 
Registered: Jan 2007
Location: Budapest
Distribution: Debian
Posts: 74

Original Poster
Rep: Reputation: 15
Thanks! You right! I was so much confused that my pritty small progz eating so much memory...;o)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to prevent a particular domain from being cached moir Linux - Networking 2 11-04-2006 10:53 PM
using RAM not L2-cached Serena *BSD 0 05-28-2006 08:15 PM
Increased cached and swap used pbrugnone Linux - General 3 10-16-2004 05:14 AM
About buffers? eshwar_ind Programming 2 04-30-2004 05:13 AM
How to clear cached commands Kedelfor Linux - Newbie 1 01-20-2004 03:35 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration