SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SH4 Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 11-28-10, 04:32 PM   #1
Bubblehead1980
Navy Seal
 
Join Date: Apr 2009
Location: Florida USA
Posts: 6,922
Downloads: 550
Uploads: 42


Default Dumb Question:What does the 4 gig patch do?

Noticed in downloads there is a 4 gig patch for SH 4, what does this do exactly?
Bubblehead1980 is offline   Reply With Quote
Old 11-28-10, 10:09 PM   #2
Webster
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

i think its for windows XP so it uses all 4 GB of ram instead of the 3GB limit of XP


EDIT: i was wrong . . . read post below

Last edited by Webster; 12-03-10 at 12:55 PM.
  Reply With Quote
Old 11-29-10, 12:24 AM   #3
Tonga
Formerly Kpt. Hess
 
Tonga's Avatar
 
Join Date: Sep 2008
Location: 39.20 nmi from U 9
Posts: 54
Downloads: 251
Uploads: 0
Default

From the author's commentary on the program:

Quote:
This very little tool patches x86 executables in order to let them have 4GB (instead of only 2) of virtual memory on x64 platforms. This tool comes very handy for applications which need a great amount of virtual memory like games, 3D renderization, multimedia etc. To gain these 2GB, you just have to use this tool to patch the executable (*.exe file) of the software you want to have these additional GBs of virtual memory. It can be used by clicking on it and choosing the file or through command line (e.g.: "4gb_patch file.exe"). It automatically creates a backup copy of the original executable.

Why things are this way on x64 is easy to explain. On x86 applications have 2GB of virtual memory out of 4GB (the other 2GB are reserved for the system). On x64 these two other GB can now be accessed by 32bit applications. In order to achieve this, a flag has to be set in the file's internal format.


This flag defines whether the file is allowed to access more than 2 GB or not, so it just comes down to a very small simple change - but one with great effect.
Tonga is offline   Reply With Quote
Old 11-29-10, 10:26 AM   #4
irish1958
Ocean Warrior
 
Join Date: Apr 2005
Location: Carmel, Indiana
Posts: 3,250
Downloads: 320
Uploads: 11
Default

Quote:
Originally Posted by Kpt. Hess View Post
From the author's commentary on the program:



This flag defines whether the file is allowed to access more than 2 GB or not, so it just comes down to a very small simple change - but one with great effect.
To clarify, is that for XP, 32 or 64 bit only or does it pertain to Vista/Windows7, 32 or64 bit also?
Or to state the question another was, what operating systems should use the 4Gb patch, and which do not need it (for SHIII, IV, V)?
__________________
Irish1958
irish1958 is offline   Reply With Quote
Old 11-29-10, 11:10 AM   #5
Tonga
Formerly Kpt. Hess
 
Tonga's Avatar
 
Join Date: Sep 2008
Location: 39.20 nmi from U 9
Posts: 54
Downloads: 251
Uploads: 0
Default

The patch is only intended to be used on x64 Windows platforms (XP64, Vista64, Win7 64), since 32 bit operating systems usually have another default setting concerning the virtual memory allocation. As a standard, x86 based OS can only recognize and use up to 4 GB of virtual memory. Per default, 2 GB would be allocated to the kernel and 2 GB to user programs, which is absolutely fine for most purposes like office stuff, mailing and also many games etc. The downside however is that you might have some programs that would need more virtual memory than the operating system actually allows them to get. For these cases (e.g. like a heavily modded SH3), you can edit the boot.ini file and add a NT-kernel switch which forces the system to alter its distribution balance to 3 GB for user programs and only 1 GB for the system.
The boot.ini file is usually hidden unless you explicitly check the checkbox for showing hidden system files in the folder options.

You might want to have a look at this post, Fubar2Niner was so kind to collect some examples of how to edit the boot.ini:
http://www.subsim.com/radioroom/show...54&postcount=6

However, keep in mind that the boot.ini is an important system file and should only be edited with particular caution. Some basic info on the boot.ini: http://en.wikipedia.org/wiki/NTLDR

Due to the 2 GB limitation described above, 32 bit exe-files have the flag "can use > 2 GB" unchecked in their internal file format, so that they can never use more than 2 GB. 64 bit systems however are capable of working with more than 4 GB and therefore this flag actually means that it only limits the file and cuts short possible performance increases. The patch now just changes this flag setting and allows the file to use more than just 2 GB.

So, in general, the 4GB patch should be applied if you intend to run these games in an 64 bit OS environment. For 32 bit operating systems you would have to use the 3 GB kernel switch.

Last edited by Tonga; 11-29-10 at 11:22 AM.
Tonga is offline   Reply With Quote
Old 11-29-10, 12:43 PM   #6
ZigmundFreund
Watch
 
Join Date: Sep 2010
Location: All around occident
Posts: 28
Downloads: 28
Uploads: 0
Very enlightening indeed! Thanks for sharing Kapitan Hess and Fubar2Niner of course!

You !
__________________
"My fellow Americans, I am pleased to tell you today that I've signed legislation which outlaws Russia forever. The bombing begins in five minutes."
- Ronald Reagan

- Some help finding big battles using RSRDC: Combined Fleet and Pacific War Animated
ZigmundFreund is offline   Reply With Quote
Old 11-29-10, 05:38 PM   #7
fred8615
Saint of the seas
 
fred8615's Avatar
 
Join Date: Mar 2004
Location: Sorrento, Louisiana
Posts: 1,305
Downloads: 265
Uploads: 127
Default

Let me ask this outright since I'm still not sure. I have Win 7 64 bit. Should I use this?
fred8615 is offline   Reply With Quote
Old 11-29-10, 05:52 PM   #8
Madox58
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

Especially on a 64 bit system.
Make a backup copy of the SH4.exe before you run the Patch.
Just in case.
But it only changes one byte so there should be no problems.
  Reply With Quote
Old 11-29-10, 07:31 PM   #9
Jan Kyster
Ace of the Deep
 
Join Date: Oct 2006
Posts: 1,151
Downloads: 152
Uploads: 0


Default

Why would we use this for SH IV?
AFAIK we don't have issues with unstable or crashing SHIV due to lack of memory? Or at all? Don't ever recall it crashing...
Jan Kyster is offline   Reply With Quote
Old 11-29-10, 07:44 PM   #10
Madox58
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

If a program is limited to how much memory it can use?
It could cause stutters, slow actions of many kinds, etc.........
If it can reach more memory?
It can work better in many ways.
Some ways would save read and writes to your HDDs.
If you need it, use it.
If you have no issues?
Don't use it.
Give it a try cause you can always get rid of it.
Or you may give a report to answer all questions that will henceforth be called...........

Jan Kyster's
'After testing the 4 Gig patch thingy? Here's the low down!'



And I am not being mean or sarcastic incase you wonder.
  Reply With Quote
Old 11-29-10, 08:01 PM   #11
Tonga
Formerly Kpt. Hess
 
Tonga's Avatar
 
Join Date: Sep 2008
Location: 39.20 nmi from U 9
Posts: 54
Downloads: 251
Uploads: 0
Default

Quote:
Originally Posted by fred8615 View Post
Let me ask this outright since I'm still not sure. I have Win 7 64 bit. Should I use this?
I also have Win 7 64 bit. You can give it a try, absolutely. The patching tool should make a backup by itself, but as privateer said, make sure you have one.

Quote:
Originally Posted by Jan Kyster View Post
Why would we use this for SH IV?
AFAIK we don't have issues with unstable or crashing SHIV due to lack of memory? Or at all? Don't ever recall it crashing...
I myself only found some improvements concerning SH3, a better overall performance, almost no program crashes etc. any more. However I did never experience that much of an improvement with SH4, so I guess it really depends on the system one uses. SH4 is indeed quite stable, but with SH3 that's still a different story. There you would never go without...

Just on a side note - there are other games that may also profit from this patch. German Truck Simulator for example now rewards me with almost 15 fps more since I patched the exe. Saint's Row 2 also shows a better fps performance (about 15-20 fps more on my notebook here). I am still testing this with Battlefield 2 and several mods as well as with GTA 4. The most obvious effect you might notice is a considerable decrease in loading time.
As long as you always make a backup, testing this with other games might prove quite useful.
Tonga is offline   Reply With Quote
Old 11-29-10, 08:02 PM   #12
Sailor Steve
Eternal Patrol
 
Sailor Steve's Avatar
 
Join Date: Nov 2002
Location: High in the mountains of Utah
Posts: 50,369
Downloads: 745
Uploads: 249


Default

Some time ago I went out and bought another two GB of memory. Now I find out I wasted my money, as my system is 32 bit.

Oh well.
__________________
“Never do anything you can't take back.”
—Rocky Russo
Sailor Steve is offline   Reply With Quote
Old 11-29-10, 08:06 PM   #13
Madox58
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

The patch I posted here is only for SH4 version 1.5
That was done to avoid problems with the Programmer of the Universal Patcher and permissions.
And was also done in a way that works well for SubSim.
Since the Patch here is only for SH4 version 1.5?
(And the SH3 versions)
The downloads are targeted.
  Reply With Quote
Old 11-29-10, 09:08 PM   #14
Jan Kyster
Ace of the Deep
 
Join Date: Oct 2006
Posts: 1,151
Downloads: 152
Uploads: 0


Default

Right, done some testing now.

Before each test, these steps were followed:
- boot system
- wait 3 mins for W7 to settle
- load Process Monitor
- run the SH4.exe (made two: SH4-ORG.exe and SH4-LAA.exe)
- start process monitor
- play a bit
- exit SH4
- read Process Monitor

Test 1, standard TMO career, approaching harbour for attack, 9 ships in play.
Test 2, run single mission "Tokio-Saipan Convoy", 23 ships in play.

Screenshots of Process Monitor.

Test 1, org. and patched:





Test 2, org. and patched:





For Process Monitor and (another) LAA-program: http://forums.techpowerup.com/showthread.php?t=112556

I notice, the CPU barely breakes any sweat...


Conclusion:
I found no difference, but at least it didn't crash SH4. Seems to run unaffected.
Would like to test, if someone has a mission with a humongeous load of ships...


"Hey! It's only a drill!"

.
Jan Kyster is offline   Reply With Quote
Old 11-30-10, 08:49 PM   #15
Jan Kyster
Ace of the Deep
 
Join Date: Oct 2006
Posts: 1,151
Downloads: 152
Uploads: 0


An interesting update!

Thought of making a really heavy mission with quadzillions of ships, but then it struck me! The OM Museum!
Always known as a "Not To Be Used!" option because of crash!


So loaded OM with all stuff and quite right - SH4 crashed.


Here's the Process Monitor screendump.
Note how the max. memory use do not exceed 1.65 GB! but it still crashes...




Now the LAA patched SH4 Process Monitor screendump:






Conclusion:
Reason for SH4 crashing in Museum, is because of the 2GB limitation. Using the LAA patch now allows for opening the museum.
Max. memory 2.21 GB for OM!



However, the sea is very strange.
Like high speed water flow... but of course, noone has ever seen it before...



Been running with the LAA patch for some 10 hours and have found no side effects, so I would say it's safe to use.
And if you would like to see the Museum, it's a must have!



/edit, note re. memory use.

Extra memory used for 9 to 23 ships = 1.40GB to 1.48 = 80MB
With Max memory = 1.65GB = crash, then we have 1.64GB-1.48GB = 160MB in real overhead.

Which is only twice of what required to meet 22 ships in the open ocean. No harbour, shallows, land etc.

All my installs now have the LAA patch. Imho it's a must have. Thanks for the hint, BubbleHead!

Core i7-930, 6GB, Win7 64-bit used in test.

Btw. Bubble, you should change the thread title to "[Solved] What does the 4 gig Patch do?"
It does nothing but good!

Last edited by Jan Kyster; 12-01-10 at 12:42 AM. Reason: Final conclusion: it's a must have.
Jan Kyster is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 05:36 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 1995- 2024 Subsim®
"Subsim" is a registered trademark, all rights reserved.