[Bug 197842] kernel memory leak

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Wed Jun 24 17:42:20 UTC 2015


John Refling <netbsdrat at gmail.com> changed:

           What    |Removed                     |Added
                 CC|                            |netbsdrat at gmail.com

--- Comment #1 from John Refling <netbsdrat at gmail.com> ---
I have this problem NOW on 10.1-RELEASE.

I am using memtest to test the RAM.  It seems to me that I had this problem a
long time ago, and there was bad RAM, and replacing that made the problem go

That was a different machine from this one.  I've made 2 passes of memtest
without errors, however I'll let it run for a few more days to try to duplicate
the temperature extremes.

Anyhow, I have a program that I wrote that copies a lot of files to multiple
disks, like 17,000 files.  I ran it several days ago, and system crashes with
the error in the original poster's post.

I ran the program yesterday, and it ran to completion, no problem.  Could be a
temperature thing + RAM.

I also put in some diagnostics on each loop of the program:

char *delete = malloc(100);
fprintf(stdout, "%p\n", delete);
system("sysctl vm.kvm_free vm.kvm_size");

The loop enters for each directory on the disk, not for each file, so there
might be 900 loop entries.

Now the vm.kvm_free and vm.kvm_size remain mostly constant.

BUT the pointer to the delete is malloc()ed at 1000 (hex?) bytes greater each
time the loop enters !!!

I don't do any malloc()s after main().  This is probably not a reliable way to
test things, but it looks suspicious.  !!!

Is there a better way to get the amount of free memory at any instant, probably
another sysctl parameter.

Anyhow this is just very frustrating and hard to track down.

I had another issue that never got sorted out after years, on 9.1:



John Refling

You are receiving this mail because:
You are the assignee for the bug.

More information about the freebsd-bugs mailing list