Mutagen-Modding / Mutagen.Bethesda.Analyzers

A project to diagnose and analyze the health of a mod or a load order
GNU General Public License v3.0
14 stars 4 forks source link

Report/Remove unneccesary persistance #95

Open Elscrux opened 2 years ago

Elscrux commented 2 years ago

Some records are flagged as persistent, although they don't need to be (there are several causes for that). This results in them being loaded into memory permanently without any reason.

A potential algorithm could like this: If the record is persistent and one of the following doesn't apply, report/remove persistence: Record isn't a door, texture set (?), fake water plane, Map/Portal/Room/Plane/MultiBound/COC Marker reference No linked references No script attached Reference doesn't have a location ref type Record doesn't have the "Is Full LOD" flag checked (not sure about this one) Probably some more conditions: run on Skyrim and see what should be conditioned as well

mrudat commented 2 years ago

From https://www.reddit.com/r/skyrimmods/comments/ag4wm7/psa_the_reference_handle_cap_or_diagnosing_one_of/ - I believe that at present, if the record isn't in a master (.esm/.esl/.esp with the master flag), then flagging it as temporary just makes you feel good.

Elscrux commented 2 years ago

This post talks about something else. It says when you have non-master plugins with temporary references, you might hit the ref handle limit of 1048576, because they are loaded all the time as well. But that's something that should be checked for as well - non-master plugins with too many refs.