[Scummvm-tracker] [ScummVM :: Bugs] #12345: BASE: The detection plugin is almost always loaded in memory

ScummVM :: Bugs trac at scummvm.org
Sun Sep 19 07:28:42 UTC 2021


#12345: BASE: The detection plugin is almost always loaded in memory
------------------------+------------------------
Reporter:  ccawley2011  |       Owner:  (none)
    Type:  defect       |      Status:  new
Priority:  normal       |   Component:  --Unset--
 Version:               |  Resolution:
Keywords:               |        Game:
------------------------+------------------------
Comment (by Die4Ever):

 I tried to see if the plugin system could handle the unloading of the
 global data and string tables, but that doesn't seem to work

 in groovie/detection.cpp I put

 {{{
 static byte garbage[1024*1024*1024];
 }}}


 and did a memset on it to make sure it actually touches that memory
 then in base/main.cpp

 {{{
 #if defined(UNCACHED_PLUGINS) && defined(DYNAMIC_MODULES) &&
 !defined(DETECTION_STATIC)
                         // Unload all MetaEngines not needed for the
 current engine, if we're using uncached plugins
                         // to save extra memory.
 PluginManager::instance().unloadPluginsExcept(PLUGIN_TYPE_ENGINE_DETECTION,
 NULL);
                         PluginManager::instance().unloadAllPlugins();
                         warning("stop!");
                         while(1) {}
 #endif

 }}}

 using top, the memory usage stays high

 either the plugin system will need to be upgraded to find a way to delete
 the global data and string tables, or the detection data would have to be
 put into binary data files and read on demand

 there could possibly be a way to automate the generation of the data files
 without changing all the code for them, idk how much we care about DS
 support and other devices with 4MB of RAM though
-- 
Ticket URL: <https://bugs.scummvm.org/ticket/12345#comment:1>
ScummVM :: Bugs <https://bugs.scummvm.org>
ScummVM


More information about the Scummvm-tracker mailing list