Skyrim Memory Patch - fixing ILS, uGrids CTD, freezes

any kind of mods
  • Author
  • Message
Offline
Posts: 4
Joined: 19 Jan 2014, 02:51

Re: Skyrim Memory Patch - fixing ILS, uGrids CTD, freezes

JAP1226 wrote:I tried to follow ZerOxShadows' instructions but couldn't generate the .dll file. After compiling, the release folder doesn't contain any other files besides loader_common.lib. Anyone have any ideas why this happens?
Did you change the project from "debug" to "release"? =P

But who says you have to compile it yourself? In the same post, he offers the file already compiled.

And whoever manages RealVision ENB on the Nexus has also added this fix to its optional downloads.

Offline
Posts: 21
Joined: 24 Jan 2013, 12:59

Re: Skyrim Memory Patch - fixing ILS, uGrids CTD, freezes

Fix definetly improved stability, but I still get CTD once in a while. Every time this error pops up:

Image

Tried raising MemBlock values from 512/256 to 768/768. Didnt help. I have like 230 .esp files and 4/2k textures, so yeah, its very heavy. PC: 2500k/680GTX 2gb/16gb/SSD, Win7 64x. Any help would be welcome

Offline
User avatar
*blah-blah-blah maniac*
Posts: 17552
Joined: 27 Dec 2011, 08:53
Location: Rather not to say

Re: Skyrim Memory Patch - fixing ILS, uGrids CTD, freezes

JAP1226
Dll file not generated only in case of compilation error, so check the output window of compiler at the bottom. I'm using Visual Studio 2008 and it works, don't know about 2010.

mindw0rk
There are many other bugs in the game, this fix is not panacea. But try to remove mods (nobody guarantee that they are bug free) and configure skyrimprefs.ini to almost default one, because all changes to threads count and many other properties absolutely wrong, if you made them.
_________________
i9-9900k, 64Gb RAM, RTX 3060 12Gb, Win7

Offline
*sensei*
Posts: 286
Joined: 20 Sep 2012, 00:20
Location: the perfect system

Re: Skyrim Memory Patch - fixing ILS, uGrids CTD, freezes

I just wanted to take a moment to say how much I appreciate it when knowledgeable people choose to share their work with the community. This little hack has done wonders to stabilize my game (no ILS so far), which is of great value to me, and many others. I hope you don't mind I posted a compiled version using Daetarek's modifications to allow configuration through the .ini.

Using VMMAP I see the first block does indeed go over 256mb fairly quickly, by about 708kb, though it never filled 512mb after about 30minutes of play, and that is on a reasonably modded game (not too many heavy script mods, but lots of HD textures.)

Offline
Posts: 13
Joined: 30 Oct 2013, 04:36

Re: Skyrim Memory Patch - fixing ILS, uGrids CTD, freezes

acethewolf wrote:Anyone been able to reproduce this with fallout3/NV?
I've had no luck messing with the binaries, but I'm just a lowly peasant when it comes to asm.
/sorryforpostingthisinaskyrimforum
Have you looked at VMMap for New Vegas? It looks like they changed things around a fair bit for Skyrim. Making the largest chunk (200 MB) larger doesn't seem to provide any benefit for New Vegas the way it seems to for Skyrim (I'm not even sure if that allocated chunk is equivalent to Skrim's first 256 MB chunk). I'm also not sure if the following 64 MB chunk is equivalent to Skyrim's 256 MB second chunk.
http://i44.tinypic.com/4r739c.png

Offline
Posts: 9
Joined: 29 May 2013, 18:34

Re: Skyrim Memory Patch - fixing ILS, uGrids CTD, freezes

Hello,
I have 4 gig of system ram and 2 gig on my video card. Will this patch benefit me at all, or not? Thanks for this and congrats to those enjoying their new freedom.

Win7 Home Premium x64
E8400 Wolfdale Core2 running @3.6
Gforce GTX 660

Offline
Posts: 39
Joined: 08 Jan 2014, 14:59
Location: Lyon, France

Re: Skyrim Memory Patch - fixing ILS, uGrids CTD, freezes

Tase wrote:
refusedzero wrote:@Tase - would be very interested to see your dll.
Certainly.

The DLL's code is simply

Code: Select all

#include "skse/SafeWrite.h"
#include "skse/Utilities.h"

BOOL WINAPI DllMain(HANDLE procHandle, DWORD reason, LPVOID reserved)
{
	if (reason == DLL_PROCESS_ATTACH)
	{
		//mem fix from enbforums
		UInt32 MemBlock1 = 256;
		UInt32 MemBlock2 = 256;
		UInt32 enableMemPatches = 0;
		_MESSAGE("Tase's Evil Non-Steam Memory Patcher... HUEHUEHUE... All credits to Sheson for this patch...");
		if (GetConfigOption_UInt32("NotPlacebo", "GiveFirstBornToSheson", &enableMemPatches))
		{
			GetConfigOption_UInt32("NotPlacebo", "MemBlock1", &MemBlock1);
			GetConfigOption_UInt32("NotPlacebo", "MemBlock2", &MemBlock2);

			if (enableMemPatches)
			{
				_MESSAGE("Sheson took your first born in exchange for more memory");
				
				_MESSAGE("Set your first Memory Block to = %i", MemBlock1);
				_MESSAGE("Set your second Memory Block to = %i", MemBlock2);

				//These patch addresses only apply to tesv.exe 1.9.32.0.8
				//do not use this on any other version!

				SafeWrite32(0x00687e87 + 2, MemBlock1 + 256);
				SafeWrite32(0x00a4e6be + 1, MemBlock2 * 1024 * 1024);

				SafeWrite8(0x004bd832 + 1, 0x11);
			}
		}
		//end mem fix
	}

	return TRUE;
}
Injection is just the Steam one

Code: Select all

	// inject the dll
	switch(procHookInfo.procType)
	{
		case kProcType_Steam:
		{
			std::string	steamHookDllPath = runtimeDir + "\\skse_steam_loader.dll";

			injectionSucceeded = InjectDLLThread(&procInfo, steamHookDllPath.c_str(), true);
		}
		break;

		case kProcType_Normal:
		{
			std::string	memPatchDllPath = runtimeDir + "\\mempatch.dll";
			InjectDLLThread(&procInfo, memPatchDllPath.c_str(), true);

			injectionSucceeded = InjectDLL(&procInfo, dllPath.c_str(), &procHookInfo);
		}
			break;

		default:
			HALT("impossible");
	}
On my rig I can only push it up to this by running from Whiterun to Markarth :(

http://puu.sh/6stKm.png

I need something more memory intensive, maybe upgrading Skyrim HD from Lite to Full ?
Thks Tase. Much cleaner version than mine. I will try it as soon as possible. ;)

Offline
Posts: 2
Joined: 21 Jan 2014, 02:59

Re: Skyrim Memory Patch - fixing ILS, uGrids CTD, freezes

dehydrated wrote: Have you looked at VMMap for New Vegas?
It looks like they changed things around a fair bit for Skyrim. Making the largest chunk (200 MB) larger doesn't seem to provide any benefit for New Vegas the way it seems to for Skyrim
Yea I have but I was mainly looking at 3, not that they differ a lot as far as memory allocation goes. It should provide the same type of benefit with CTD's when pushing ugridstoload value
Are you any good with disassembly because I'm unsuccessful in finding where the 200mb of memory is being allocating in either 3 or NV's executable.

Anyway this offtopic discussion probably won't be tolerated very long, sorry.

Offline
User avatar
Posts: 9
Joined: 19 Jan 2014, 04:37

Re: Skyrim Memory Patch - fixing ILS, uGrids CTD, freezes

thalixte wrote:
Tase wrote:
refusedzero wrote:@Tase - would be very interested to see your dll.
Certainly.

The DLL's code is simply
Thks Tase. Much cleaner version than mine. I will try it as soon as possible. ;)
Let me know how this works. I'll add it to the extended tutorial to include Non-Steam users when I can tomorrow and give you guys the credit.

Offline
*sensei*
Posts: 286
Joined: 20 Sep 2012, 00:20
Location: the perfect system

Re: Skyrim Memory Patch - fixing ILS, uGrids CTD, freezes

Thanks for the guides, ZerOxShadows.

Something I am curious about, is what sort of read/writes are these memory blocks reserved for, and what can cause the amount demanded to increase? I am guessing some tables of all objects loaded in the current cell, which would mainly increase with uGrids values over 5? Textures all get loaded into a separate shared video memory space, right? Also, am I wrong in assuming this is purely reserved for internal engine processes, and that modding the heck out of the game really wouldn't cause it to need more space in these areas (unless the mods added a ton more objects to the world)?
Post Reply