I'm using easyh10 1.4, cui on Debian Linux.
I had been using 1.2.1, where UTF-8 was the only
supported encoding -- my filenames are encoded in
Due to the encoding problem, easyh10 1.2.1 consumed
huge amounts of memory (> 2GB), because the recursive
listing of files in the Music directory was buggy --
directories it couldn't read due to the wrong
encoding were appended a "/..", thus reading those
directories multiple times.
My ~2500 files became > 140.000 files. The recursion
probably only stopped when MAX_PATH was reached (the
paths grew longer all the time (i.e.
In the beginning, I didn't notice that those dupes
were causing the memory hogging, so I had a look at
the code to find places where some memory could be
One such place I found is struct
tag_media_target_file -- instead of using arrays with
the full MAX_PATH length, it would suffice to use the
actual filename's length.
Additionally, I noticed, that the array holding all
those file entries is being realloc()ed for every
single file that is added. I.e. 140.000 times for
Doing this in chunks of e.g. 500 entries is much
This patch may not be necessary anymore, because I
will probably never get 140.000 real files onto my
20GB H10, but it doesn't hurt either, and nobody
knows the next generation H10 hdd size.
Log in to post a comment.