Source Code Project Mantis - FSSCP
View Issue Details
0003177FSSCPmodelspublic2015-12-11 17:382017-02-15 11:01
Assigned Tom_m 
PrioritylowSeveritycrashReproducibilityhave not tried
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0003177: pofspew causes game to run out of memory
DescriptionAs reported by Inferno, running -pofspew and attempting to load all the models causes the game to run out of memory. Several "out of memory" errors appear in the log before the game finally crashes with "Malloc Failed!"

This happened because Inferno was trying to regenerate cache files. I told them that the cache feature was deprecated, so they don't need to run this anymore; therefore I've marked this as low priority. Nevertheless, it indicates that -pofspew may have a memory leak somewhere.
Additional InformationLog attached.
TagsNo tags attached.
Attached Files7z fs2_open.log.7z (130,099) 2015-12-11 17:39

2015-12-12 00:56   
It might just indicate that we're hitting 32-bit memory limitations again, rather than that there's a memory leak with -pofspew in particular (although I suppose it could be argued that -pofspew not unloading anything until reaching the 295th POF could be classified as a "memory leak" of sorts).
2015-12-14 10:24   
Yes, in the context of Java, "memory leak" also refers to memory piling up without being freed. It should be unloading the models after "spewing" them.
2017-02-15 05:04   
I think I fixed this by explicitly unloading the model after reading it:

In my tests with Blue Planet the current master version reaches uses over 3 GB of memory. With my changes it never goes above 1.3 GB.

Issue History
2015-12-11 17:38Goober5000New Issue
2015-12-11 17:39Goober5000File Added: fs2_open.log.7z
2015-12-11 17:40Goober5000Statusnew => confirmed
2015-12-12 00:56MageKing17Note Added: 0016799
2015-12-14 10:24Goober5000Note Added: 0016801
2017-02-15 05:04m_mAssigned To => m_m
2017-02-15 05:04m_mStatusconfirmed => code review
2017-02-15 05:04m_mNote Added: 0016867
2017-02-15 11:01m_mStatuscode review => resolved
2017-02-15 11:01m_mResolutionopen => fixed