On Tue, Jan 6, 2009 at 8:53 AM, Moinak Ghosh <moinakg at belenix.org> wrote: > On Tue, Jan 6, 2009 at 2:28 AM, Dave Miner <dminer at opensolaris.org> wrote: >> Moinak Ghosh wrote: >>> >>> Hi, >>> >>> So I got a working solution now and got a successful livecd boot off >>> a lofi-compressed ramdisk. This solution satifies various requirements >>> even for normal harddisk boot and avoids the need for multiple different >>> solutions. More details here: >>> >>> http://moinakg.wordpress.com/2009/01/01/reducing-opensolaris-ramdisk-greed/ >>> >> >> This is quite cool, Moinak. Out of curiosity, what's the difference in: >> >> - memory usage > > Memory usage while booting is no worse than the existing mechanism > that gzip compresses the files inside boot archive. This memory gets > eventually freed. > > Memory usage while running initially the same as the compressed size. > In BeleniX 0.7.1 82MB ramdisk gets compressed to 29MB. Once writes > happen the size grows maybe a couple of MBs. I have to add a variable > to track actual usage and enhance ramdiskadm output to print it. > Size growth is not unbounded however. The maximum growth is limited > by the maximum size and free space that the filesystem was configured > with. For eg. in an 82MB ramdisk if 4MB is free then UFS knows of that > and will only allow 4MB more writes to happen. So runtime size will be > limited to 29 + 4 = 33MB. >
On second thoughts that size calculation overlooks certain points since existing files can be overwritten and metadata can be updated like access times. So the worst case memory consumption can occur if every file on the ramdisk is overwritten, which in this example will be 29 + 82 = 111MB. However obviously this is very much a contrived example and not a practical scenario. In addition mounting UFS with noatime option will reduce unnecessary writes. So for practical considerations, around 33MB is the approx figure. Regards, Moinak. -- ================================ http://www.belenix.org/ http://moinakg.wordpress.com/
