1

I have read here on how to set the LARGEADDRESSAWARE flag and this is done to my Windows Service. This Windows Service is however hosting a WCF service based on another project and this service is using library's and so on from other projects.

I need the entire application to use the LARGEADDRESSAWARE, is it enouth to set it on the Window Service project(ServiceBase)? Or do I need to set it on all projects?

At this point I can´t switch to 64bits so this will have to do.

Community
  • 1
  • 1
Banshee
  • 15,376
  • 38
  • 128
  • 219

1 Answers1

1

It is not an option that's exposed by the IDE, you'll to turn it on by running editbin.exe in a post-build event. This answer shows the commands you need to use.

Do note however that it is fairly likely that you are wasting energy on this. It will only have an effect when the operating system can provide an execution environment that supports "large addresses". That used to be possible many years ago with the /3GB boot option but has stopped being useful a while ago. Also very detrimental on servers, they really need the kernel address space. It is still useful when your server boots a 64-bit version of Windows, any 32-bit code can get a 4 GB address space if they are linked with /LARGEADDRESSAWARE. But if you have such an operating system then changing the project's Target platform to AnyCPU is certainly the much more productive way to take advantage of the much larger address space you get in a 64-bit process. Maybe that doesn't apply in your specific case but is otherwise the best general advice.

Community
  • 1
  • 1
Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
  • Sorry but this do not answer my question. The application is running on a 64 bits env so no problems there. Specific details makes it impossible to run it as a 64 platform so 32 will have to do and to make this work the LARGEADDRESSAWARE needs to be set. I have runned a couple of tests and it seems like the process can use over 2GB ram now. But im still not sure if this editbin needs to be runned on all referenced dll files or just on the main exe file? – Banshee Jun 12 '13 at 12:47
  • Only the EXE matters. Seeing it using more than 2 jiggabytes sure sounds like it was an answer to your question, complaining that it wasn't makes no sense whatsoever. – Hans Passant Jun 12 '13 at 12:53
  • I have only one "?" in my question and this is my one and only question but thanks for providing some extra information. – Banshee Jun 12 '13 at 12:57
  • Hmm, I noticed before that you treat SO like a personal help desk. That's not the way it works around here. Questions are but a little cog in the great scheme of SE. – Hans Passant Jun 12 '13 at 13:01