Newsgroup: it.comp.os.linux.software
Titolo: LINUX Server Reboot Frequency

Are there guidelines for server reboot?
We are running Oracle databases on this server,  I suspect that memory 
starts leaking if we do not reboot this busy server for say 3-6 months as 
memory starts swapping and server started running low on memory. But after 
the reboot everything is back to normal.
Is there a way to check memory leak? Any commands?
How often one should be rebooting a server? 

 How often one should be rebooting a server?
It Depends(tm). Updating a kernel requires it, but not much else does under 
Linux: I've seen systems that were stable for *years* doing very limited 
tasks.
However, if this is a core service, I'd plan to schedule a bit of 
maintenance downtime once a month: You may not need it any given month, but 
that way you have a scheduled downtime. 

 wrote in message 
news:2a-dnQC3hKRt0Cbe...@comcast.com...

Thanks!
But how can I check a memory leak? Any commands?
<Free> does not give any info. about memory leaks. 


You probably don't need to reboot the server, just stop and restart the
Oracle database.
When Oracle stops, all it's resources (including leaked memory) should be
given back to the OS, and be ready to be re-allocated as required.
It may bee that doing a reboot is the easiest way to do this, but if there
are any other services running on the box, restarting Oracle may be less
disruptive overall.
-- 
Reverend Paul Colquhoun, ULC.    
http://andor.dropbear.id.au/~paulcol
     Asking for technical help in newsgroups?  Read this first:
 
http://catb.org/~esr/faqs/smart-questions.html#intro

 disruptive overall.
OK: you can't "check for memory leaks" in such closed source code, you can 
only check that the amount of RAM being used is expanding: the "top" command 
will give a hint, and you should be able to poke around in the /proc 
filesystem and find some appropriate flags associated with the Oracle 
processes that can be examined to see how large they are.
Linux tries hard to keep as much in RAM as feasible: it's only when things 
start overflowing RAM, such as a database that's been up for a while and 
gotten really, really big with people doing work on it or a program with a 
memory leak, that you start swapping and things slow down. Paul is right 
that just restarting the Oracle server should get it to release all 
resources.
To understand how leaks happen, read the manual pages on "free" and 
"malloc". Notice that "free" does not give the memory back to the system! It 
only frees up memory to be used by the same program, so that the next malloc 
can occur in that freed up memory space. But it's very easy to make mistakes 
with a big database or big program, mistakes in userland, that generate 
*grotesquely* large tables for only a few minutes, and they can never be 
returned to the system without restarting the program: they're only 
preserved for further use by that program.
Now, Oracle is supposed to have all sorts of nifty fail-over behavior which 
I've never gotten a chance to push: if you have such a setup, it should be 
possible to keep the servers synchronized, reboot one while the other takes 
the load, then restore the first server without that overflowing RAM 
problem, then a week later reboot the second one while the first takes the 
load. I've done things like that for DNS and DHCP, for various reasons, and 
it seems to work well. 

Numero Uno wrote:

The first fault is assuming Oracle is the offending application.  There is a
good chance you are right, but have not performed due diligence on
identifying the actual issue.  In addition, if you are running a Java VM
inside Oracle, you may have an issue with object allocation and its impact
on garbage collection.  This could be a result of the application written
to run within Oracle.  Are you running a pure Oracle DBMS? Or running
things like Oracle Application Server?
There are a great number of questions that need to be answered before you
assume Oracle has a memory leak.

 it seems to work well.
I guess Oracle does not use Glibc's malloc and free, but implements its own
memory management.  It is quite possible that Oracle is optimized for "owning"
the computer. If memory at some point is available, why give it up and later
perhaps not get it again?  Better keep it.  Let the other programs have the
trouble.
-Enrique

 trouble.
Who knows? It's closed source, very proprietary, multi-platform, and clearly 
written for big iron, not casual implementation by any means. Using its own 
memory management makes sense, but at some point you sort of *have* to talk 
to glibc unless you want to rewrite a lot of very, very basic functions from 
scratch. 



Thanks everyone!