linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Memory leak
@ 2002-06-20  7:52 Skip Gaede
  2002-06-22  2:22 ` Skip Gaede
  0 siblings, 1 reply; 5+ messages in thread
From: Skip Gaede @ 2002-06-20  7:52 UTC (permalink / raw)
  To: linuxppc-dev


Folks,


I'm looking for a recipe on how to track where my memory is
disappearing to. I am running kernel 2.4.19-pre10-ben0,
patched for the nubus-pmac platform. I have 40 MB RAM and a
100 MB swap file on the local hard disk.


I am using the MkLinux booter and the kernel with an initrd.
During the first init, I get an IP address and the path to
the NFS root. I then do a pivot-root, and run the XFree86
Server -query 192.168.0.1, where I do an autologon, and
start up KDE 3.0.1 and Mozilla 1.0 running Choffman's
browser buster. I also am running the snmp daemon, so I can
monitor memory use from my server with a perl script.


When first booted, the kernel takes about 16 MB of memory,
and after starting the X server, I have about 2000k
available physical memory, and no swap file usage. Over
the next 7 hours, I eat up about 20 MB of swap file, and at
some point the available physical memory drops down to
about 150k for about an hour and then the system locks up.
During the same period of time, I can monitor memory use on
the client on another console, and the amount of memory
allocated to each process remains fairly stable up until
lockup.


I'd like to understand what's going on. Can someone suggest
what data I ought to be collecting, or perhaps some
parameters I can tweak to modify the behavior?


Thanks,
Skip


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: Memory leak
@ 2002-06-20 15:06 diekema_jon
  0 siblings, 0 replies; 5+ messages in thread
From: diekema_jon @ 2002-06-20 15:06 UTC (permalink / raw)
  To: sgaede, linuxppc-dev


> I'm looking for a recipe on how to track where my memory is
> disappearing to. I am running kernel 2.4.19-pre10-ben0,
> patched for the nubus-pmac platform. I have 40 MB RAM and a
> 100 MB swap file on the local hard disk.

I have a similar problem, and I have to back down to Linux 2.4.4.
Linux 2.4.8 and newer had a problem, but 2.4.4 was ok.  Somewhere
between 2.4.4 and 2.4.8 the problem appeared.  If you want more
details as to what versions after 2.4.8 that had problem I can supply
that tonight.

2.4.4 ok
2.4.8 memory leak

Our application uses a socket based network connection, and this
network activity tickled the memory leak problem.  We can run top,
and see the amount of free memory keep dropping.


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread
* Memory Leak
@ 2003-03-12 19:50 Aman
  2003-03-12 20:29 ` Matt Porter
  0 siblings, 1 reply; 5+ messages in thread
From: Aman @ 2003-03-12 19:50 UTC (permalink / raw)
  To: linuxppc embedded

[-- Attachment #1: Type: text/plain, Size: 565 bytes --]

 Hi All
 I am using consistent_alloc () to allocate consistent memory for DMA.  When
I free the buffers using consistent_free(), the /proc/meminfo shows a
memory leak of the buffer size allocated.

 I have attached a  module code to allocate memory when inserted and free
 when removed. The memory leak can be found using the command cat
/proc/meminfo.

 Also the consistent_alloc call gives an error something like "Kernel bug at
cachemap.." if we try to allocate more than 2MB.

Can anyone help me in solving these issues

Thanking you in advance
Regards
Aman




[-- Attachment #2: alloc_test.c --]
[-- Type: application/octet-stream, Size: 983 bytes --]

#define __NO_VERSION__
#include <linux/module.h>
#include <linux/version.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/slab.h>
#include <linux/sched.h>
#include <linux/ioctl.h>
#include <linux/proc_fs.h>
#include <linux/wrapper.h>
#include <asm/io.h>


typedef int sint32_t;

char kernel_version[]= UTS_RELEASE;

uint8_t        *pu8_buffer;

int init_module (void)
{
    dma_addr_t      str_phys_addr;

    printk ("Init module\n");

    pu8_buffer = consistent_alloc (GFP_KERNEL, 0x200000, &str_phys_addr);

    if (pu8_buffer == NULL)
    {
        printk ("Could not allocate memory\n");

        return 0;
    }

    printk ("Physical address = 0x%x\n", str_phys_addr);
    printk ("Virtual address = 0x%x\n", (uint32_t) pu8_buffer);

    return 0;
}

void cleanup_module (void)
{
    printk ("Freeing )x%x\n", (uint32_t) pu8_buffer);

    consistent_free (pu8_buffer);

    return;
}

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-03-12 20:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-06-20  7:52 Memory leak Skip Gaede
2002-06-22  2:22 ` Skip Gaede
  -- strict thread matches above, loose matches on Subject: below --
2002-06-20 15:06 diekema_jon
2003-03-12 19:50 Memory Leak Aman
2003-03-12 20:29 ` Matt Porter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).