Skip to content

Commit

Permalink
Fixes to layout, Lukas recommended enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
ferd committed Sep 18, 2014
1 parent 3d55c13 commit abd0fb3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
8 changes: 4 additions & 4 deletions site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@
</head>
<body>
<header>
<a title="Version 1.0.1, 2.8MB" href="https://s3.amazonaws.com/erlang-in-anger/text.v1.0.1.pdf">
<a title="Version 1.0.2, 2.8MB" href="https://s3.amazonaws.com/erlang-in-anger/text.v1.0.2.pdf">
<img id="book-cover" src="https://s3.amazonaws.com/erlang-in-anger/book-cover.png"
width="344" height="472" alt="Book Cover" />
</a>
Expand All @@ -259,7 +259,7 @@ <h1>
</header>
<article>
<section id="book">
<h2><a title="Version 1.0.1, 2.8MB" href="https://s3.amazonaws.com/erlang-in-anger/text.v1.0.1.pdf">Free Ebook</a></h2>
<h2><a title="Version 1.0.2, 2.8MB" href="https://s3.amazonaws.com/erlang-in-anger/text.v1.0.2.pdf">Free Ebook</a></h2>

<p>
This book intends to be a little guide about how to be the Erlang
Expand All @@ -269,8 +269,8 @@ <h2><a title="Version 1.0.1, 2.8MB" href="https://s3.amazonaws.com/erlang-in-ang
developers debug production systems that were built in Erlang.
</p>

<a id="download" title="Version 1.0.1, 2.8MB"
href="https://s3.amazonaws.com/erlang-in-anger/text.v1.0.1.pdf">
<a id="download" title="Version 1.0.2, 2.8MB"
href="https://s3.amazonaws.com/erlang-in-anger/text.v1.0.2.pdf">
<span>Download PDF</span>
</a>
</section>
Expand Down
20 changes: 13 additions & 7 deletions text.tex
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,14 @@

Thanks for the additional work, reviewing, and/or editing done by:

\emph{Jacob Vorreuter}, \emph{Seth Falcon}, \emph{Raoul Duke}, \emph{Nathaniel Waisbrot}, \emph{David Holland}, \emph{Alisdair Sullivan}, \emph{Lukas Larsson}, and \emph{Tim Chevalier}.
\emph{Jacob Vorreuter}, \emph{Seth Falcon}, \emph{Raoul Duke}, \emph{Nathaniel Waisbrot}, \emph{David Holland}, \emph{Alisdair Sullivan}, \emph{Lukas Larsson}, \emph{Tim Chevalier}, and \emph{Paul Bone}.

\null
\vfill
%\vspace*{\fill}
The cover image is a modified version of from \href{http://www.freeimages.com/photo/533163}{fallout shelter} by \href{http://www.freeimages.com/profile/drouu}{drouu} on \href{http://sxc.hu}{sxc.hu}.
\cfoot{\emph{v1.0.1}}
\cfoot{\emph{v1.0.2}}
\rfoot{\emph{2014-09-18}}

%% License as of Monday, August 18, 2014:
%%
Expand All @@ -107,7 +108,8 @@

\clearpage
%%%

\pagenumbering{roman}
\setcounter{page}{1}

\tableofcontents

Expand All @@ -116,10 +118,13 @@
%% Colors of figure refs for text
\hypersetup{linkcolor=violet}


\chapter*{Introduction}
\markboth{\MakeUppercase{Introduction}}{}
\addcontentsline{toc}{chapter}{Introduction}
\label{chap:introduction}
\pagenumbering{arabic}
\setcounter{page}{1}


\section*{On Running Software}
%\addcontentsline{toc}{section}{On Running Software}
Expand Down Expand Up @@ -1150,7 +1155,7 @@ \subsection{Memory}

This requires some explaining.

First of all, all the values returned are in bytes, and they represent memory \emph{allocated} (memory actively used to store Erlang terms from the internal Erlang memory allocators, not the memory set aside by the operating system for the Erlang VM). It will sooner or later look much smaller than what the operating system reports.
First of all, all the values returned are in bytes, and they represent memory \emph{allocated} (memory actively used by the Erlang VM, not the memory set aside by the operating system for the Erlang VM). It will sooner or later look much smaller than what the operating system reports.

The \expression{total} field contains the sum of the memory used for \expression{processes} and \expression{system} (which is incomplete, unless the VM is instrumented!). \expression{processes} is the memory used by Erlang processes, their stacks and heaps. \expression{system} is the rest: memory used by ETS tables, atoms in the VM, refc binaries\footnote{See Section \ref{sec:binaries}}, and some of the hidden data I mentioned was missing.

Expand Down Expand Up @@ -2164,7 +2169,7 @@ \subsubsection{The Global Level}
\begin{enumerate*}
\item \term{temp\_alloc}: does temporary allocations for short use cases (such as data living within a single C function call).
\item \term{eheap\_alloc}: heap data, used for things such as the Erlang processes' heaps.
\item \term{binary\_alloc}: the allocator used for reference counted binaries (what their 'global heap' is).
\item \term{binary\_alloc}: the allocator used for reference counted binaries (what their 'global heap' is). Reference counted binaries stored in an ETS table remain in this allocator.
\item \term{ets\_alloc}: ETS tables store their data in an isolated part of memory that isn't garbage collected, but allocated and deallocated as long as terms are being stored in tables.
\item \term{driver\_alloc}: used to store driver data in particular, which doesn't keep drivers that generate Erlang terms from using other allocators. The driver data allocated here contains locks/mutexes, options, Erlang ports, etc.
\item \term{sl\_alloc}: short-lived memory blocks will be stored there, and include items such as some of the VM's scheduling information or small buffers used for some data types' handling.
Expand Down Expand Up @@ -2238,7 +2243,7 @@ \subsubsection{The Global Level}
Finally, starting with Erlang version 17.0, each \term{alloc\_util} allocator on each scheduler has what is called a \emph{\term{mbcs} pool}. The \term{mbcs} pool is a feature used to fight against memory fragmentation on the VM. When an allocator gets to have one of its multiblock carriers become mostly empty,\footnote{The threshold is configurable through \href{http://www.erlang.org/doc/man/erts\_alloc.html\#M\_acul}{http://www.erlang.org/doc/man/erts\_alloc.html\#M\_acul}} the carrier becomes \emph{abandoned}.
This abandoned carrier will stop being used for new allocations, until new multiblock carriers start being required. When this happens, the carrier will be fetched from the \term{mbcs} pool. This can be done across multiple \term{alloc\_util} allocators of the same type across schedulers. This allows to cache mostly-empty carriers without forcing deallocation of their memory.\footnote{In cases this consumes too much memory, the feature can be disabled with the options \term{+MBacul 0}.} It also enables the migration of memory blocks across schedulers when they contain little data, according to their needs.
This abandoned carrier will stop being used for new allocations, until new multiblock carriers start being required. When this happens, the carrier will be fetched from the \term{mbcs} pool. This can be done across multiple \term{alloc\_util} allocators of the same type across schedulers. This allows to cache mostly-empty carriers without forcing deallocation of their memory.\footnote{In cases this consumes too much memory, the feature can be disabled with the options \term{+MBacul 0}.} It also enables the migration of carriers across schedulers when they contain little data, according to their needs.
\subsubsection{The Process Level}
\label{subsec:memory-process-level}
Expand Down Expand Up @@ -2784,6 +2789,7 @@ \subsection*{Hands-On}
\bookmarksetup{startatroot} % Split conclusion from previous Part
\addtocontents{toc}{\bigskip} % Add space in ToC
\chapter*{Conclusion}
\markboth{\MakeUppercase{Conclusion}}{}
\addcontentsline{toc}{chapter}{Conclusion}
Expand Down

0 comments on commit abd0fb3

Please sign in to comment.