How much free memory?

How much free memory?

Post by Douglas Klei » Thu, 26 Feb 1998 04:00:00



We have an E5000 with 4gb RAM and max. shared memory set at 3gb for
Sybase.  Prior to rebooting the server, vmstat showed free memory as
72,304.  Nobody was logged in and no jobs were running except the Sybase
servers.  After rebooting the server and starting 3 instances of Sybase,
vmstat shows free memory as 579,984.  Does vmstat really show available
memory or is it maybe pages not used after 'x' amount of time?  We have
a lot of developers on this box.  Do we have some bad code that isn't
releasing memory?  Is there a better tool to determine the amount of
free memory?

Thanks.

 
 
 

How much free memory?

Post by Anthony Mandi » Fri, 27 Feb 1998 04:00:00



> We have an E5000 with 4gb RAM and max. shared memory set at 3gb for
> Sybase.  Prior to rebooting the server, vmstat showed free memory as
> 72,304.

        72,304 what? MB?

Quote:> Nobody was logged in and no jobs were running except the Sybase
> servers.  After rebooting the server and starting 3 instances of Sybase,
> vmstat shows free memory as 579,984.  Does vmstat really show available
> memory or is it maybe pages not used after 'x' amount of time?  We have
> a lot of developers on this box.  Do we have some bad code that isn't
> releasing memory?  Is there a better tool to determine the amount of
> free memory?

        You can try 'top'. Its adequate for showing real, free and
        swap and what a process is using and how much it has resident.

-am

 
 
 

1. attempt to free, allready freed memory .. rfc

Hello !
As allways, i have a problem. Thus i want ask you for comment.

Today i had a strange problem with my customers program. It is very
fresh soft, and they are still strugling with it (developing i meant :-)
). But they were stucked on very strange problem.

[explanation of problem in program- ommited]

Problem it self.

this code will be an example.

struct doom{
        int data1;
        int data2;
        void *mydata;

doom doomed;

void dosomething_with_data(doom *d)
{      
//      .... doing some fancy operations
//      then..
        if (d->mydata)
        {
                free(d->mydata);
                d->mydata=NULL;
        }

void main()
{
        int i,j;
        void *t;

        // this program is just not doing anything important :-)

        t=doomed.mydata=malloc(somenumberofbytes);
        if (t==NULL){
                return;
        }

        dosomething_with_data(&doomed);

// plenty of lines and finally ........
        if (doomed.mydata)
        {
                free(doomed.mydata);
                doomed.mydata=NULL;
        }

// now i will get strange behavior in other structures
// seems like it is a memory leak.....

well, finding this error in somebody software was not easy.
Finaly i tested simmilar behavior on windows, and... it was not better.
But under compilation with m$ comiler in debug mode gived me assert on
first attempt to free allready freed memory.
Is this behavior system has to take ? (i mean segfault)
which options for gcc i have to use to get assertion in case of such
error (i guess malloc seats in glibc, thus debug version of this liblary
might have this). But i am not sure. Waiting for comments.

--

K4 Labs

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

2. DHCP and my Cable Modem.

3. free memory ALWAYS goes down showing by top and free

4. do u know

5. Free memory not free ??? Pls Hlp!

6. OK, I"m willing to try one more distro...

7. "free" in vmstat is not free memory page scanner sees, is it?

8. news offers linux support

9. free memory and actual memory installed...

10. How to check the amount of free memory in share memory

11. Cached memory vs free memory

12. 32 Meg Memory+64 Meg Swap = No free Memory

13. Free memory, memory usage