@
Dax9 Yeah, when I said "rebooting" I mean restarting the Kodi application. In my Linux setup Kodi is used as shell, so restarting Kodi is basically rebooting the system. In general, it helps to start building the DBs with a just started Kodi to avoid the Out of Memory errors. Interestingly, I only get the Out of Memory errors in the testing Windows machines but never on my Linux machines at home (this is not a big surprise, Linux memory management is much better than Windows). Also, if AML or other plugin crashes I recommend to restart Kodi because when some addon crashes I think there is a memory leak that reduces the memory available for subsequent calls of the addons.
I finished coding the new iterative JSON enconder and also did a bit of memory optimizations. If you wish you can try the current version in Github. I have reduced the memory consumption from 867 MB to 612 MB when building all MAME DBs. The JSON writing time is more or less doubled, but this shoudn't be much of a problem because the DBs are created only when AML is updated or you install a new version of MAME or the DAT/INIs. If interested, this are the results of my tests:
Code:
Build all databases, older fast writer, OPTION_COMPACT_JSON -> 867 MB
fs_write_JSON_file() "C:\Kodi\userdata\addon_data\plugin.program.AML\MAME_DB_main.json"
fs_write_JSON_file() Writing time 8.258000 s
fs_write_JSON_file() "C:\Kodi\userdata\addon_data\plugin.program.AML\MAME_DB_render.json"
fs_write_JSON_file() Writing time 2.981000 s
fs_write_JSON_file() "C:\Kodi\userdata\addon_data\plugin.program.AML\MAME_DB_roms.json"
fs_write_JSON_file() Writing time 13.724000 s
fs_write_JSON_file() "C:\Kodi\userdata\addon_data\plugin.program.AML\ROM_Audit_DB.json"
fs_write_JSON_file() Writing time 12.347000 s
Build all databases, newer slow writer, OPTION_COMPACT_JSON -> 621 MB
fs_write_JSON_file_lowmem() "C:\Kodi\userdata\addon_data\plugin.program.AML\MAME_DB_main.json"
fs_write_JSON_file_lowmem() Writing time 13.526000 s
fs_write_JSON_file_lowmem() "C:\Kodi\userdata\addon_data\plugin.program.AML\MAME_DB_render.json"
fs_write_JSON_file_lowmem() Writing time 4.979000 s
fs_write_JSON_file_lowmem() "C:\Kodi\userdata\addon_data\plugin.program.AML\MAME_DB_roms.json"
fs_write_JSON_file_lowmem() Writing time 22.240000 s
fs_write_JSON_file_lowmem() "C:\Kodi\userdata\addon_data\plugin.program.AML\ROM_Audit_DB.json"
fs_write_JSON_file_lowmem() Writing time 20.663000 s
Also, I saw in the log you are using the ROM/Asset cache option. This will make browsing in AML very fast but increases the DB building time considerably and requires the creation of about 12000 JSON files (2 for each filtering option in AML, there are about 6000 filters because just the Manufactures catalog has about 3000 categories, that is, different manufacturers). It's OK to use it if you wish, but I disabled it by default in 0.9.6. You may try to disable it if you wish for testing, no need to rebuild the DBs when you disable it. If later you reenable it, just make sure you rebuild the cache.
I hope you will enjoy this new version of AML and thanks for testing it. I think now AML is quite feature complete and on par with the most advanced front ends out there, like QMC2. The only things missing is to implement more filtering options in the Custom Filters XML and to improve the Manual PDF reader. If you think of any feature that may be useful or find a bug please let me know.