Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
629 views
in Technique[技术] by (71.8m points)

windows - How do I create a (32-bit) .NET application to use 3 GB RAM?

I am creating a .NET application (C#) that needs to use a lot of RAM. I recently knew that on 32-bit versions of Windows XP I can only use 2 GB, unless I use the /3Gb switch, and set the IMAGE_FILE_LARGE_ADDRESS_AWARE flag in the executable header. But since I'm developing a .NET application, I guess I cannot modify the executable directly, can I? So, what should I do to allow my application to utilize the 3 GB?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

An .NET exe is still a standard PE file; so you could try using editbin /LARGEADDRESSAWARE to set the flag, but note that this won't work if you are using something like ClickOnce (since that maintains a cryptographic hash of the files).

However, note that you'll still have the same .NET limits in terms of the maximum size of a single object/array. For huge amounts of memory, x64 is a better idea.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...