Linux & Memory Management (or lack thereof)

Linux & Memory Management (or lack thereof)

Post by Garrett D'Amo » Sat, 08 May 1993 04:52:34

Hello Linuxers,

I encountered an interesting bug (feature?) in Linux recently.  I was
writing some code for a CS class, and I very nearly brough the system
down (Linux system)...

Basically, a piece of my code tried to calloc a big chunk of memory --
279 Mb to be exact!  (I had it output so I could see what was happening.)
But instead of calloc instantly failing and returning a NULL (since I have
only 8 Mb of RAM and 10 Mb of swap), the hard disk started to whir, things
started to slow, and the process hung until I killed it with CTRL-C.  I
thought it was a little optimistic for the kernel to actually try to meet
this request... probably the most obliging kernel I've ever seen... :)

It seems to this poor programmer that the kernel or libraries or whatever,
ought to be smart enough to realize when a request is *clearly* bigger than
any RAM & Virtual RAM available combined, and immediately return a NULL to
the stupid program who asked for such an * amount of memory.  Is this
something that can reasonably be fixed in the next release of the libraries/
kernel, and/or fixed with a patch?

I am running kernel 0.99.pl9, gcc 2.3.3, and shared libs 4.3.3.  I was using
the -Wall -g flags to gcc at the time.

Incidentally, for the curious, I was attempting to implement a one-to-one
bitmapped hash-table.  When I gave it a somewhat unreasonable case, and it
tried to calloc so much space, I decided that a hash table with buckets was
more reasonable to implement.

I can provide source for the code that caused this problem to those debugging
the libraries or kernel.  E-mail me to get a copy.


Software Co-Ordinator           |     68 Barrows Hall, UC Berkeley
Haas Computing Services         |     Ph: 510-643-5923 Fax: 642-4769


1. Linux hardware support (or lack thereof)

Hardware support has been a big prob for me. Nothing I have in my
computer now (well maybe floppy and cdrom drives....) is supported, and
it kinda ticks me off cus Windows just sucks. Anyway this is becoming a
big problem I think (It seems only old hardware, like an SB16 i had in
an old comp, is supported right) and getting bigger as all the new
consumer-level hardware isn't being supported. Well mebbe not all, but

Anyway, I recall reading somewhere that someone had suggested, as a
solution to M$'s monopoly, to make M$ liscense out Windows source.... I
have another idea: What if the Government made M$ change the terms for
companies that intend on making hardware for windows? Like if it forced
all the hardware companies to release the specs for their hardware so
that 'someone out there' could write a Linux driver for it, rather than
keeping it all secret and stuff.....

2. unix ftp API ???

3. Corel Linux Installation or Lack Thereof

4. iostat, vmstat is ridiculously fast in 5.6

5. Problem with Mandrake 7.2 and Sound [lack thereof]

6. Need help with DDB

7. IPSEC VPN masquerading, or the lack thereof, in Swoothwall

8. pppd and PAP

9. Addonics SV750 sound (or lack thereof)

10. Netscape Fonts in RH 5.1 (or lack thereof)

11. Epson Stylus 740 USB initialization (or lack thereof)

12. Apollo lint (or lack thereof)

13. Modem speed or lack thereof.....