[syslinux] [PATCH 0/2] improve Lua API for files and initramfs objects

Ferenc Wágner wferi at niif.hu
Thu Nov 10 06:04:20 PST 2016

Paul Emmerich <P.Emmerich at first-colo.net> writes:

> initramfs:load_file() is basically a memory optimization over your
> solution.  It calls initramfs_load_file() directly, this loads the
> file exactly once into memory.


> Going through a Lua string loads the file, then copies it into a
> (interned) Lua string, then copies this string again in
> initramfs:add_file(). This doubles the peak memory usage (might even
> triple it if you are not freeing the file before passing it into
> add_file)
> This is a concern for our setup: we load relatively large wimboot
> images and support relatively small VMs at the same time.

Then calling initramfs_load_file() directly is a useful optimization

More information about the Syslinux mailing list