Skyrim Memory Patch - fixing ILS, uGrids CTD, freezes

any kind of mods
  • Author
  • Message
Offline
Posts: 10
Joined: 20 Jan 2014, 00:30

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

Tuoni wrote:
Tase wrote:stuff
I have two questions:

1) What is the difference between your patch and Uriel24 patch? Is it just the location of the .dll and.log files or is there also a functional difference?

2) Why do you have the "ClearInvalidRegistrations" and "iTintTextureResolution" in your .ini file? What do they do and should I add it to my .ini file too?

Sorry if I'm difficult but I'm just trying to keep track of all the different versions people post of this memory patch.
I assume both versions functionally do the same thing.

And those two ini settings are just tweaks, they don't have any relation to the memory patch.

Offline
Posts: 6
Joined: 27 Oct 2013, 18:45

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

Just want to say thank you mate! You've saved my game. I was so close to uninstalling and starting again. I think I have around 280 mods, from hd textures, additional npcs to tons of scripts. I was getting CTD every 10 mins or so.

Since installing this last night I quite happily played for 3 hours without a single crash, and I actually closed the game down myself rather than the game closing for me!

If you're ever in London look me up and I'll buy you a beer or 10! :D

Offline
Posts: 1
Joined: 20 Jan 2014, 12:56

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

Hello and thanks to sheson, uriel and tase for their great effort so far!

I think everything is working for me now using tases latest version of the patch.

I'd like to give some feedback though:
  • First i used shesons original patch. Since i run the game on a non-steam setup, I tried to make it work for myself by modifying the loader.exe like explained on p7 in this thread. Referring to the logs and vmmap it kinda worked but the actual used memory didn't go beyond 256MB in vmmap even though it could use up to 512MB.

    Then i tried uriels universal patch. First i made a clean SKSE install, then i copied over the patch files. The game started, logfiles show, the patch was injected but ingame i got a message from SkyUI, that it was not running due to a version conflict with SKSE?!

    After that i tried tases alternative version he posted yesterday, the one which didn't make a logfile itself. The game started, vmmap showed it was working and the actual used memory crawled up beyond 256MB, which made me happy :)
Think its working now. I'll probably give tases new version a shot, since i'd like to have mempatch.dll create its own logfile, though it seems not to be neccessary at all.

But again...Guys, thanks for your work and making the game stable and more playable :)

Offline
Posts: 31
Joined: 23 Jul 2013, 17:55

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

Maybe you guys have noticed this but I'll report it anyway.

The original skse_steam_loader.dll is 114KB in size, so if you're adding code to it then compile it, it should be larger size, no?

If you compile the dll using VS2010 with no updates or service pack, the dll size is 107KB , witch is odd because you added code so it should be larger then 114KB .

If you compile the dll using VS2010 with service pack and all updates, the dll size is 108KB , witch is still odd because you added code so it should be larger then 114KB.

Also, when you compile using VS2010, if you look at the output log it shows:

========== Build: 2 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


Now, "PurpleLaunchBox" said "SKSE only supports building on VS2008 due to a language change from C++11." in the following post:
http://forums.bethsoft.com/topic/147887 ... p=23273343

So I went ahead and downloaded VS2008 90Trial from here:
http://download.microsoft.com/download/ ... 435622.iso

Now when I compile the dll using VS2008 with service pack and all updates, the dll size is 122KB. It is now larger then the original dll since i've added code to it, witch makes sense.

Also, when you compile using VS2008, if you look at the output log it shows:

========== Build: 3 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

So.. I say it's better to compile the dll using VS2008.
_________________
I5 3570k @ 4.5 GHz / GTX 660 Ti 3GB SLI / ASUS P8Z77-V / 8GB RAM / 4TB HDD's / Win7, Win8.1 64-bit

Offline
Posts: 6
Joined: 20 Jan 2014, 18:13

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

Tuoni wrote:
Tase wrote:The version I linked works for both Steam and Non-Steam; for the Steam case, you still need the patched skse_steam_loader.dll

If you run my version on Steam without the patched skse_steam_loader, it will just run like a normal SKSE


Here is a All Encompassing Patch, it works on Steam and Non-Steam, since there seems to be a bit of confusion :

https://dl.dropboxusercontent.com/u/228 ... mpatch.rar

Drop in your Skyrim Folder, includes the SKSE.ini with 512/256 settings, ClearInvalidRegistrations and iTintTextureResolution.

If you're using Steam, you don't need mempatch.dll, if you're not using Steam, you don't need skse_steam_loader.dll

You can confirm it works by checking the SKSE logs and inspecting the allocated memory size in VMMap.

EDIT: Updated mempatch.dll to make it's own .log
I have two questions:

1) What is the difference between your patch and Uriel24 patch? Is it just the location of the .dll and.log files or is there also a functional difference?

2) Why do you have the "ClearInvalidRegistrations" and "iTintTextureResolution" in your .ini file? What do they do and should I add it to my .ini file too?

Sorry if I'm difficult but I'm just trying to keep track of all the different versions people post of this memory patch.
You may check this: http://skse.silverlock.org/skse_whatsnew.txt

- ClearInvalidRegistrations to remove invalid OnUpdate() registrations. This prevents orphaned OnUpdate() events and the resulting bloated/broken saves when removing certain mods. When applied to an already bloated save, it will stop growing further and instead shrink over time as the game processes all queued events. This may take hours depending on the amount of bloat.

- Set [Display] iTintTextureResolution=<number> to pick the size of dynamically built tint textures (default is 256).

Offline
*sensei*
Posts: 289
Joined: 08 Dec 2012, 23:05

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

So, wich one is working for both steam and non-steam users? If it's Tase's latest one, i'll remove a link to my version to make less confusion for users.

Tase some people cant properly create and place an skse.ini cause they've never used it. Maybe it's better to make changes to enable the patch by default with recommended 512 and 256 blocks, even if ini lines are missing? Advanced users will then be able to disable patch or change the block sizes by the ini, if required, while regular users will be freed of this.
And less faulty reports about the patch not working, because someone just misplaced the ini or overwrote it with another one, or has skse.ini.txt with hidden txt part... Whatever else there is.

BTW, i had some reports that Skyrim crashes if you switch to other task and then try to switch back. That's olds? Maybe this memory allocation tweak breaks some tweaks from ENB or SKSE plugins?
_________________
i5 2500k@4.0ghz - 24Gb RAM - R9-290 4Gb Tri-X - SSD 240gb Intel 520 - Win7x64

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

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

Hi Tase and Uriel24.

I made my own version of the universal mempatch, that enables by default Memblock1 to 512 and Memblock2 to 256.

This version uses Neovalen's skse.ini settings:
[Memory]
Enable=1
MemBlock1=512
MemBlock2=256

Tks again Tase, and of course, all credits go to sheson's fix. ;)

Here is the code:
mempatch.dll =>

Code: Select all

#include <tlhelp32.h>
#include <direct.h>
#include <shlobj.h>
#include "skse/skse_version.h"
#include "skse/SafeWrite.h"
#include "skse/Utilities.h"

IDebugLog	gLog;
HANDLE		g_dllHandle;

BOOL WINAPI DllMain(HANDLE procHandle, DWORD reason, LPVOID reserved)
{
   if (reason == DLL_PROCESS_ATTACH)
   {
	  gLog.OpenRelative(CSIDL_MYDOCUMENTS, "\\My Games\\Skyrim\\SKSE\\mempatch.log");
	  gLog.SetPrintLevel(IDebugLog::kLevel_FatalError);
	  gLog.SetLogLevel(IDebugLog::kLevel_DebugMessage);

	  FILETIME	now;
	  GetSystemTimeAsFileTime(&now);

	  _MESSAGE("skse loader %08X %08X%08X %s", PACKED_SKSE_VERSION, now.dwHighDateTime, now.dwLowDateTime, GetOSInfoStr().c_str());
	  _MESSAGE("base addr = %08X", g_dllHandle);

      //mem fix from enbforums
      UInt32 MemBlock1 = 512;
      UInt32 MemBlock2 = 256;
      UInt32 enableMemPatches = 0;
      _MESSAGE("Tase's Evil & Thalixte Non-Steam Memory Patcher... HUEHUEHUE... All credits to Sheson for this patch... and Daetarek and Neovalen for their skse.ini modifications...");
      if (GetConfigOption_UInt32("Memory", "Enable", &enableMemPatches))
      {
         GetConfigOption_UInt32("Memory", "MemBlock1", &MemBlock1);
         GetConfigOption_UInt32("Memory", "MemBlock2", &MemBlock2);

         if (enableMemPatches)
         {
            _MESSAGE("Skyrim Memory Patch 3.0 by Sheson Active.");
            
            _MESSAGE("MemBlock1 = %i", MemBlock1);
            _MESSAGE("MemBlock2 = %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;
}
skse_loader.exe main.cpp modification =>

Code: Select all

   bool	injectionSucceeded = false;

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

	if(injectionSucceeded)
	{
		// 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:
		   {
			  injectionSucceeded = InjectDLL(&procInfo, dllPath.c_str(), &procHookInfo);
		   }
			  break;

		   default:
			  HALT("impossible");
		}
	}
Last update: I've decided to delete the link provided in order to respect skse copyright. Waiting for the next skse release that will include the sheson's fix.
Last edited by thalixte on 25 Jan 2014, 23:55, edited 3 times in total.

Offline
Posts: 37
Joined: 21 Jan 2014, 14:52

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

Uriel24 wrote:So, wich one is working for both steam and non-steam users? If it's Tase's latest one, i'll remove a link to my version to make less confusion for users.

Tase some people cant properly create and place an skse.ini cause they've never used it. Maybe it's better to make changes to enable the patch by default with recommended 512 and 256 blocks, even if ini lines are missing? Advanced users will then be able to disable patch or change the block sizes by the ini, if required, while regular users will be freed of this.
And less faulty reports about the patch not working, because someone just misplaced the ini or overwrote it with another one, or has skse.ini.txt with hidden txt part... Whatever else there is.

BTW, i had some reports that Skyrim crashes if you switch to other task and then try to switch back. That's olds? Maybe this memory allocation tweak breaks some tweaks from ENB or SKSE plugins?
Have not tried Tase's latest one but i'm willing to test it out for the non steam users among us :)

About Skyrim crashing when you switch to other task... I've lost the ability to Alt+Tab out of Skyrim since i started using ENB. At best nothing happens when i press Alt+Tab, worst i get a blackscreen and the complete system hangs.
I can Alt+Tab out and in Skyrim just fine when i disable ENB. Playing in fullscreen with SLI enabled.

Ok then i have a complete n00b question..
I'm willing (and want) to use VMMAP to verify that the patch is working and give good feedback if a patch version works or not. But.. where do i need to look at the VMMAP screen to see the information i need? There are 3 bars on top and lot of columns under those bars. All with fancy names which all doesn't really mean that much much to me :oops:
Which bar(s), column(s) and/or name(s) i need to focus on?

ps.
The anti bot thing is getting a bit silly. I often getting bounced back to the anti bot page when i try to post something or quote someone :? which means back to the main page, click news, click forum, click forum name, click thread and hope i'm not getting bounced back to the anti bot page again.

Offline
*sensei*
Posts: 289
Joined: 08 Dec 2012, 23:05

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

While Skyrim is running, launch VMmap and select TESV.exe process. Select "Private Data" in the upper table, the lower one turns all yellow at this point. Then you sort the lower one by size and look at the size of the two largest records. If the patch works, their size will match the settings in your skse.ini.
_________________
i5 2500k@4.0ghz - 24Gb RAM - R9-290 4Gb Tri-X - SSD 240gb Intel 520 - Win7x64

Offline
Posts: 35
Joined: 12 Jun 2013, 06:49

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

Aminados wrote:Maybe you guys have noticed this but I'll report it anyway.

The original skse_steam_loader.dll is 114KB in size, so if you're adding code to it then compile it, it should be larger size, no?

If you compile the dll using VS2010 with no updates or service pack, the dll size is 107KB , witch is odd because you added code so it should be larger then 114KB .

If you compile the dll using VS2010 with service pack and all updates, the dll size is 108KB , witch is still odd because you added code so it should be larger then 114KB.

Also, when you compile using VS2010, if you look at the output log it shows:

========== Build: 2 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


Now, "PurpleLaunchBox" said "SKSE only supports building on VS2008 due to a language change from C++11." in the following post:
http://forums.bethsoft.com/topic/147887 ... p=23273343

So I went ahead and downloaded VS2008 90Trial from here:
http://download.microsoft.com/download/ ... 435622.iso

Now when I compile the dll using VS2008 with service pack and all updates, the dll size is 122KB. It is now larger then the original dll since i've added code to it, witch makes sense.

Also, when you compile using VS2008, if you look at the output log it shows:

========== Build: 3 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

So.. I say it's better to compile the dll using VS2008.
The failure report seems to be a peculiarity rather that a catastrophe, though. You still get a valid DLL out, I've been using it for a few days without issue so far.

The size difference almost certainly doesn't matter. I suspect that VS2010 is simply generating less code because it is doing a better job at optimising, or there is less code elsewhere being linked into the DLL (or both).
Post Reply