Jump to content

Sacred 2 Memory leak fix


Recommended Posts

Besides using the new version of Mss32.dll my advise is to always do a "quick-save" whenever your character is in a safe place. After doing that then press the Alt key and while holding it tap Tab. The game will do a memory purge which should extend game-play for a bit. A real time memory flusher is the only alternative that I know of, as even the beefiest of rigs have similar Sacred 2 game crash issues.

Link to comment

I picked up a new toon last night and decided to play for a few hours, with today being my day off of work and all I managed to play for like four and a half hours total. Running a HE similar to the Secret Agent build (emphasis on Mystic Stormite so lots of effects on-screen).

 

So basically I've tried running the game with and without the custom definitions on the Nvidia CP, Physx and Elite Textures, in various combinations. Bottom line, the game tends to crash more often with Physx/ET turned on (no surprises here), and the custom definitions on the Nvidia CP don't seem to make it any different whatsoever. So basically my guess is that it all comes down to the dreaded memory leak issue, since sooner or later the game starts lagging and then comes to a halt. Curiously though, with both Physx/ET turned off and the Nvidia CP settings on the game runs mighty fine. Not saying it won't crash but so far it's been running smooth and crashless. I'm not really sure if it actually makes the game more stable but it does seem to make it run smoother, probably because of the GPU taking care of extra instructions in terms of textures (which it does), so it may not be a proper solution but smoother it seems to be.

 

I've given up on Physx/ET for now because it's of no use. As much as I'd like to play the game with all the bells and whistles it just doesn't cut it since it keeps crashing extremely randomly. Will happily repeat this procedure with CM 1.60 installed to see if there's any noticeable differences.

Link to comment

I tried all the info I could find online, including a command prompt to disable open gl but it still crashes. I only just found that theres a quick save key, default F7 so I'll just have to use that before entering dungeons or map porting.

Also when the game crashes, it just freezes for me and ctrl - alt - del leads to black screens. The only way I found around this is with my dual monitors and keeping task manager open on the second screen so I can alt tab to it to close any such crashed games (when any game crashes for similar reasons, I tend to get stuck screens). 

Edited by bhav
  • Like! 1
Link to comment

Yeah it just sounds like the classic memory leak problem.  There's no beating it.  Best workaround right now is hitting ALT+TAB every so often because it flushes system memory.  This can cause issues of its own, though, so its a poor fix.

We're testing a legitimate coding fix - one that flushes the memory whenever you use a portal or change levels - this should be happening anyway and it's not in the vanilla game.

  • Like! 1
Link to comment

This entire issue is one of insufficient Random Access Memory when the game demands more after tying up whatever amount our systems are set to allocate. It matters not, the quantity of RAM ones rig has, but how much is available at the time it is demanded. Therefore, the fix is to let the game have more to play with. I tested this hypothesis by using Glary Utilities 5 (free version). After installation, go to the Advanced tab and select Memory Optimizer. Then increase, even double or more, the current free amount of memory. Now, click "Optimize" and after it's done go to options and set it to Enable Auto Optimization and to Load automatically on Windows Startup. This fixed the problem for me, even when using Elite Textures. I will try PhysX next but I expect another positive result.

 

For your added convenience, I have attached the set up file for GlaryUtilities. The tool has some other nice options to play with. However, I don't recommend the Disk Defrag tool for they who employ a Windows 10 Operating System or a Solid State Drive. Remember, SSDs should not be defragmented.

gu5setup.exe

  • Like! 1
Link to comment
3 minutes ago, Hooyaah said:

This entire issue is one of insufficient Random Access Memory when the game demands more after tying up whatever amount our systems are set to allocate. It matters not, the quantity of RAM ones rig has, but how much is available at the time it is demanded. Therefore, the fix is to let the game have more to play with. I tested this hypothesis by using Glary Utilities 5 (free version). After installation, go to the Advanced tab and select Memory Optimizer. Then increase, even double or more, the current free amount of memory. Now, click "Optimize" and after it's done go to options and set it to Enable Auto Optimization and to Load automatically on Windows Startup. This fixed the problem for me, even when using Elite Textures. I will try PhysX next but I expect another positive result.

 

For your added convenience, I have attached the set up file for GlaryUtilities. The tool has some other nice options to play with. However, I don't recommend the Disk Defrag tool for they who employ a Windows 10 Operating System or a Solid State Drive. Remember, SSDs should not be defragmented.

gu5setup.exe

This is a great post, Hooyaah... yer game really doesn't crash anymore even with the highest textures on?

:blink:

 

gogo

Link to comment

I am running a rig with an Intel i7-3960X CPU @ 3.30GHz, 16GB RAM, a NVidia GeForce GTX 1080Ti, and dual SSDs with the game running on the 930GB secondary drive. Even with a good gaming PC my game was crashing after approximately 20 minutes. I played over an hour and a half using the fix I described and experienced no problems when transporting, etc. and I believe memory allocation to be the only fix unless a coding fix to auto-flush the memory can be integrated into the game.

  • Like! 1
Link to comment
22 minutes ago, Hooyaah said:

I am running a rig with an Intel i7-3960X CPU @ 3.30GHz, 16GB RAM, a NVidia GeForce GTX 1080Ti, and dual SSDs with the game running on the 930GB secondary drive. Even with a good gaming PC my game was crashing after approximately 20 minutes. I played over an hour and a half using the fix I described and experienced no problems when transporting, etc. and I believe memory allocation to be the only fix unless a coding fix to auto-flush the memory can be integrated into the game.

 

18 minutes ago, Flix said:

As is, the game is always going to crash once it passes the 1.5GB threshold.

Not to disparage whatever people are doing to cope.  You may well delay hitting that threshold in multiple ways, because the game doesn't actually NEED 1.5GB of RAM, it just accumulates more and more RAM usage the longer you play and the more areas you visit.  

But when we roll out this fix, anyone who wants to test it will need to "cease and desist" with all the workarounds, 3rd party utilities, etc.  We'll need to be sure there's no other factors muddying the water.

My own tests so far have been promising  Loading and transitioning areas takes a tad longer, but I can't force a crash.  I teleport everywhere, over and over, no crashes.  I run around in problematic areas like the Blood Forest, no crashes.  I think Dmitriy really pulled off a feat here.  I'm hoping to have a test version ready in a week or two at most.

 

 

I love this guys

Finally ... salvation!

A Hooyaah's  fix for now, and one for ever more.. I'm excited that you cant even push that crash Flix, bravo Dmitriy !

:bounce:

gogo

Link to comment

Flix, if this works as advertised once its available to us poor souls suffering in the freezing hell, I'll happily declare you a saint and start worshipping you.

 

I'm eagerly awaiting the results of your work :)

  • Like! 1
Link to comment
6 hours ago, Yaohu said:

Flix, if this works as advertised once its available to us poor souls suffering in the freezing hell, I'll happily declare you a saint and start worshipping you.

 

I'm eagerly awaiting the results of your work :)

These crashes have been a frustrating mainstay of Sacred gaming since... gosh for hundreds or years now

A solution o'er the horizon is incredible news to hear

And which makes me ask, is it only now because of so much time spent with the code tthat fixing the crashes is possible? Is there a reason the original devs weren't able to have it fixed when the game  was mainstream?

:)

 

gogo

Link to comment
27 minutes ago, Flix said:

The most generous explanation I can think of for our beloved Ascaron developers is that they were stretched too thin, and too short on time, to give the game the polish it deserved.  Therefore, there are many rough edges, many more than are immediately apparent, because so many of these rough edges concern coding.  There's just some really poor code in there.

An example would be that they didn't seem to plan AT ALL for people playing on OS's higher than Windows XP, or on 64-bit systems, even though both were commonplace at the time Sacred 2 was made.  These two things alone cause all kinds of problems.

You're hearing a lot of this memory leak information second-hand from me, as it's really dimitrius154 who did the work and told me all about the reasoning behind the changes.  Some weekend after we push out this test version, I'll try to make some threads unpacking and explaining all the details he gave me.  We've got a 40-page private discussion running as it is. :) 

I would have already put up some more posts to build hype for the new CM Patch, but I have a new IT job that's taking up all my time.  :Just_Cuz_12:

I loved the read, I think may fans as well

And good luck on the new IT job...dont become too famous!

:hugs:

 

gogo

  • Like! 1
Link to comment
On 9/13/2017 at 9:43 AM, Flix said:

I would have already put up some more posts to build hype for the new CM Patch, but I have a new IT job that's taking up all my time.  :coffeecup:

Even just knowing that more is coming is excitement enough I think!!

Link to comment
On 9/13/2017 at 11:54 AM, Yaohu said:

Once the Beta is ready to go, give me a call, I'll happily help testing it.

Other than that, good luck with your Job, just don't forget about us :lol:

Bravo Yaohu, I know the community's feedback on the mod very much helps with its development!

:)

 

gogo

Link to comment
  • 2 weeks later...

I just have 1 thing to add here, memory leak alt-tab fix doesn't always work.
In windows there's commit KB and private KB (among 2 other) as windows puts it, cleansing the memory sometimes, depending on situation will only clear the private.

If using an auto memory wipe it would not release the committed memory, only the private.

Sacred 2 will release the memory if in town, but if a boss in my case, I tested at gar'colossus shooting him from the bridge, if I alt-tabbed the game would not release memory, but still reload the textures resulting in even more memory usage than before alt-tab.

I suspect this is because the game doesn't let go of memory if there's either a boss or a damaged mob. I also noticed that the shooting animation of most spells took up more than 3MB per shot

(image only for reference, sacred not booted, I have 2 monitors so I could take photos as I run the game later if anyone's interested)

temp.JPG

Edited by Recath
  • Thanks! 1
Link to comment

Did some more testing, sorry for a second post, I have screenshots but I think it's better if I post them elsewhere with a comment on each.

I ran the lowest possible settings, all of them. I'm only gonna go over the committed memory but all memory types alt-tabbing had the same effect (everything lowered or increased)
784 644 - at launch

995 400 - just created a LAN lobby

1 088 968 - teleported to the location of gar'colossus

1 236 456 - arrived at the bridge I'm gonna attack from

796 556 - alt-tabbed out of the game and back in

928 440 - shot him a few times, (can't see his healthbar, far away)

985 312 - alt-tabbing after shooting a few shots

994 360 - alt-tabbing 2nd time

998 788 - alt-tab 3rd

1 005 132 - 4th, this time running Glary Utilities

1 010 832 - 5th, closed glary - probably just stable around 1 million right?

1 255 472 - attacking gar'colossus again for 2 minutes maybe (can see his healthbar)

1 341 260 alt-tabbing

1 382 524 teleported to the mount island

1 341 212 alt-tabbed on the island

1 334 048 main menu again

1 289 192 alt-tab in main menu
Without Glary even installed I get similar results

Between alt-tabs the game does lose some memory then gain memory again es expected, but it doesn't release everything, and it seems alt-tabbing affects all tabs in the resource manager (Windows 7, running CM 1.5)

Edited by Recath
  • Thanks! 1
Link to comment
3 hours ago, Recath said:

Did some more testing, sorry for a second post, I have screenshots but I think it's better if I post them elsewhere with a comment on each.

I ran the lowest possible settings, all of them. I'm only gonna go over the committed memory but all memory types alt-tabbing had the same effect (everything lowered or increased)
784 644 - at launch

995 400 - just created a LAN lobby

1 088 968 - teleported to the location of gar'colossus

1 236 456 - arrived at the bridge I'm gonna attack from

796 556 - alt-tabbed out of the game and back in

928 440 - shot him a few times, (can't see his healthbar, far away)

985 312 - alt-tabbing after shooting a few shots

994 360 - alt-tabbing 2nd time

998 788 - alt-tab 3rd

1 005 132 - 4th, this time running Glary Utilities

1 010 832 - 5th, closed glary - probably just stable around 1 million right?

1 255 472 - attacking gar'colossus again for 2 minutes maybe (can see his healthbar)

1 341 260 alt-tabbing

1 382 524 teleported to the mount island

1 341 212 alt-tabbed on the island

1 334 048 main menu again

1 289 192 alt-tab in main menu
Without Glary even installed I get similar results

Between alt-tabs the game does lose some memory then gain memory again es expected, but it doesn't release everything, and it seems alt-tabbing affects all tabs in the resource manager (Windows 7, running CM 1.5)

And welcome to DarkMatters!!

 

:gogo:

 

gogo

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...
Please Sign In or Sign Up