Re: another error with md malloc based fs



Hi Oliver,
Hi @list,

yes that's exatly what i have in my mind,
after the explainings from Chuck.

thanks very much

cheers

michael


2007/3/23, Oliver Fromme <olli@xxxxxxxxxxxxxxxxx>:

Michael Schuh wrote:
> Chuck Swiger wrote:
> > Michael Schuh wrote:
> > > i can't understand how malloc can eat all available
> > > memory, i have 2Gigs of it ;-)
> > > so it seems to me i know what i doing, if
> > > i have 1,6 Gigs free Memory, and i say ok get me 750Megs from
> > > my 1,6 Gigs of free Memory, what was faulty on that????
> >
> > The two choices involve a swap-based RAMdisk, which can use all of
> > the available physical RAM it needs to, since this memory is
> > swappable, or a kernel-memory-based RAMdisk, which uses wired-down
> > memory from within the kernel.
>
> Ok, so that is it harder to understand for me in the first time,
> if i understand it now right the swap or file based memory backend
> is also in the ram, but it get another way managed from kernels vm.
> the malloc based ramdisk get's not reallly managed by the kvm,
> but it underlays under the paging and swapping, and also
> ba the "thread-killer" there shot's thread down it it get's to much
> work for the system....
>
> i hope i understand this right, it is important for me...

Let me try to explain it with a little different words.
The following is a bit simplified, but it should give
you an idea about the advantages and disadvantages of
each md disk type.

First of all, _both_ "malloc" and "swap"-backed md disks
are RAM disks. You don't have to worry that a swap-backed
md disk will be created on your swap partiton. It's not.
It will reside in RAM, just like a "malloc" md disk.

However, the difference is that a malloc md disk uses
memory from the KVM area (kernel virtual memory), which
is hardwired into the RAM. It cannot be paged, and it
is taken from the kernel's own memory pool, which is
usually much smaller than your total available RAM.
It's taken from the same pool of RAM that's used for
network buffers, driver data and similar things.

On the other hand, "swap-backed" md disks use regular
memory, so to speak, just like a normal user process.
That also means that they are pageable, which means
that they can be paged to swap if necessary (if the
systems runs low on RAM). That's what "swap-backed"
means. Because of that, they don't have a size limit
(well, they shouldn't be bigger than your RAM + swap,
of course). If there is enough RAM, then they will
stay completely in RAM and will _not_ touch your swap
at all.

For typical RAM disks, such as for /tmp, you should use
a swap-backed md disk (it should be the default). The
"malloc" type should be used only for rather small,
special uses.

I hope it's now a little clearer.

Best regards
Oliver

--
Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M.
Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung:
secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün-
chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart

FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd

"[...] one observation we can make here is that Python makes
an excellent pseudocoding language, with the wonderful attribute
that it can actually be executed." -- Bruce Eckel




--
=== michael-schuh.net ===
Michael Schuh
Preußenstr. 13
66111 Saarbrücken
phone: 0681/8319664
mobil: 0177/9738644
@: michael.schuh@xxxxxxxxx

=== Ust-ID: DE251072318 ===
_______________________________________________
freebsd-stable@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: Slow performance
    ... I realize that the pagefile usage is excessive and I need to reduce memory ... I've never messed with those settings before. ... Peak are greatly in excess of the installed RAM. ... The Disk Defragmenter report shows you have minimal free disk space. ...
    (microsoft.public.windowsxp.perform_maintain)
  • Re: OT (slightly) swap limits
    ... influence your decision on how much swap was enough. ... processes due to lack of memory. ... I've run machines with 1Gig or more RAM with NO SWAP. ... Linux possible when before on Unix it wasn't? ...
    (Debian-User)
  • Re: SCO OSR5.0.6 System Crashed during LoneTAR Verify
    ... RAM; scrambled bits point the CPU toward disaster and it ... available that can really stress memory, but the best ones need to run ... disk corruption can cause otherwise good code to be read ...
    (comp.unix.sco.misc)
  • Re: Diagnosing extreme fps drop
    ... It's probably the game loading from disk all kinds of new textures on ... or competition for RAM by other memory hog apps like MS ... what the current and peak commit size shows in relation to the physical ...
    (alt.games.warcraft)
  • Re: High memory usage (*HELP*)
    ... Low on virtual memory does not necessarily mean anything with regard to disk ... If your system uses all the available RAM, ... acceptable for a server to put all of its available RAM to use. ...
    (microsoft.public.windows.server.sbs)