This implements Sheson's memory allocation patch. If you're using one of the unofficial modified SKSE DLL files, you need to revert back to the official SKSE files otherwise SSME won't do anything. If you're using the new build of SKSE that has support for changing the memory allocation values, you don't need SSME.

Simply put d3dx9_42.dll and ssme.ini in your Skyrim folder (the same place TESV.exe is located).

Thanks to MongoMonk for helping me test this and to Sheson for making his find public.

Frequently Asked Questions:

Q: What does this do?A: Sheson discovered that if you make Skyrim allocate more memory initially, it prevents crashes that occur later when that first allocated chunk runs out and Skyrim allocates a second chunk. SSME aims to be a very simple way to patch Skyrim so it allocates more memory.

Q: What is GiveFirstBornToSheson=1 in ssme.ini?A: Me paying homage to Sheson, as should you. He's the reason Skyrim's stability is improved. Technically that setting does absolutely nothing.

Q: I have X amount of RAM, will this help me?A: The short answer is: yes.The long answer is: how much RAM you have isn't a factor; Windows uses a paged virtual memory system.

Q: Does this conflict with d3d9.dll-based mods (like ENB)?A: No. While the file names look similar, d3dx9_42.dll is not d3d9.dll.

Q: I'm still crashing.A: SSME is simply increasing the size of the first large memory allocation Skyrim makes (well, and changing an aligned mov instruction to an unaligned mov); there are plenty of other problems that can make Skyrim crash than the one that SSME affects.

Q: I get the following Windows error message when trying to launch Skyrim after installing SSME:The procedure entry point D3DX9_43.#148 could not be located in the dynamic link library d3dx9_42.dll.A: Somehow you don't have the final version of DirectX 9 installed. It doesn't matter if you have DirectX 11 (or 10); they're independent of each other. Get the DirectX 9 installer from Microsoft here:http://www.microsoft.com/en-us/download/details.aspx?id=8109

Q: I'm getting the following error message in ssme.log:address 00687E89 unexpectedly 00000300, abortingA: That means Sheson's memory patch is already being applied by something other than SSME, and SSME is simply aborting. Note that 00000300 could be some other number.

Q: I'm getting the following error message in ssme.log:address 004BD832 unexpectedly 6086110F, abortingA: That means Sheson's memory patch is already being applied by something other than SSME, and SSME is simply aborting.

Q: I'm getting the following error message in ssme.log:address 004BD832 unexpectedly 50246C3B, abortingA: That means you ran Skyrim's Creation Kit more recently than Skyrim. While the Creation Kit also loads d3dx9_42.dll, SSME aborts patching because it's not the right program. Run Skyrim then check ssme.log.

Q: Why does this set off some anti-viruses?A: Someone who decides anti-virus detection heuristics decided that a DLL that forwards more than ~200 exports was suspicious. Not every anti-virus uses this heuristic, but a handful of them do. In theory, SSME could have its forwarded exports chopped down to only exactly what Skyrim (and the Creation Kit) needs to work, but seeing as d3dx9_42.dll has 329 exports, and it's hard to know exactly which of them Skyrim uses (beyond the 18 that Skyrim directly imports in its IAT), I'm not jumping at the chance to introduce problems into SSME. The actual solution is people need to report the flaw in the AV heuristic to the AV company so the AV company can fix it.

Q: How do I uninstall SSME?A: Delete d3dx9_42.dll, ssme.ini and ssme.log from your Skyrim folder.