During install / remove / list etc. operations opkg reads all lines of the
package list into memory and then iterates over those lines to build the
package hash table. This consumes more memory than actually needed. It
would be better to populate the hash table on the fly while reading the
list. This way memory wasting can be avoided and the processing happens in
one pass.
Attached is a proof-of-concept patch to address this - it uses a fixed
buffer to read the list file and the calling code was modified to populate
the hash table on the fly without reading the while list first. It also
suppresses the processing of package descriptions for most operations
reducing the required amount of memory even further. There is one
limitation with the suggested approach, the maximum line length is limited
to 4096 bytes, if a line exceeds this limit, the parsing will be aborted
and an error is returned.
Original issue reported on code.google.com by goo...@wwsnet.net on 22 Oct 2009 at 4:17
Original issue reported on code.google.com by
goo...@wwsnet.net
on 22 Oct 2009 at 4:17Attachments: