4 ms·
> On 32bit Windows machines, processes only have access to 2GB user space memory. You can change this in boot options to 3 or 4 (optimized) or enable PAE. see
by nikcub 15y ago
> On 32bit Windows machines, processes only have access to 2GB user space memory.
You can change this in boot options to 3 or 4 (optimized) or enable PAE. see:
http://msdn.microsoft.com/en-us/library/aa366778.aspx http://msdn.microsoft.com/en-us/library/aa366778.aspx
i'd try that before rewriting your code (also kill services you don't need, which is usually a lot of them. run -> msconfig).
Edit: you also don't mention probably the most important piece of info: which version of windows you are running.
Edit 2: make sure go is being treated as a background process
Edit 3: it seems a lot of these tips should be in the Go docs for win32 - i'll add it when I have a moment
- trimbo 15y agoImportantly, you will need to recompile with /LARGEADDRESSAWARE.
- 4ad 15y agoYeah, that kernel flag is useless without stamping the binaries, and the Go linker doesn't know about this.
- barrkel 15y agoIt's just a flag in the PE headers. It can be modified after the fact with a tool; the Go linker doesn't need to know.
- doug363 15y agoBut the reason why there is an explicit flag in the first place is that there's a lot of code out there that doesn't work with pointers >= 0x80000000, or when pointers could differ by more than that. Things like pointer "tagging", and signed integer overflow bugs, are examples of the sort of code that can be affected. Without knowing details about the Go code generation and runtime/garbage collection, it would be a bit risky to just set the flag and hope for the best.
- barrkel 15y agoOh, I know; I've written bounds-checking logic for RTLs that use casts to integers and tests for negativity to check for overrun, implicitly assuming 31-bit address space. My only point is that a limitation of the Go linker does not preclude setting the flag.
- 4ad 15y agoNo such problems in Go. I just checked and the flag is set by default in all Windows binaries.
- 4ad 15y ago> the Go linker doesn't know about this. I was wrong, it does, it's on by default :).
- yuhong 15y agoIt has nothing to do with PAE.
- Bootvis 15y agoIt seems to me it does: With PAE Windows can use more memory. This extra memory can be used to allocate the 512mb chunck. Can you clarify?
- deleted 15y ago[deleted]
- tankenmate 15y agoIt's a VM (mapping) issue not a RAM (free memory) issue.
- 4ad 15y agoAlso, with PAE, each process gets the same 32 address space as before.
- deleted 15y ago[deleted]
- malkia 15y agoEnabling /3GB and LARGEADDRESSAWARE might work, but I have found that because of certain video drivers (XP) would not work correctly with D3D or OpenGL apps (looks like some assumptions were made there that the space would be below 2GB). For one we could not get correctly our game and some of our tools to work on XP with /3GB (that was few years ago) Nowadays since we moved to Windows Vista/7 64-bit, we no longer have the problems (LARGEADDRESSAWARE) and our 32-bits sometimes go up to 3.5gb of usage.
- xpaulbettsx 15y agoOne thing to note, is that his problem is lack of contiguous VA space, not physical frames (i.e. "memory"). Killing services will do nada to help that, the only thing that will help is mapping less DLLs.
- 4ad 15y agoDLLs are loaded in a process address space only because they are referenced in the PE header or the process calls LoadLibrary(), I'm afraid killing processes won't cause mapping of less DLLs either.
- georgemcbay 15y ago"Just set these boot options" is fine if you're just deploying this code to a server you control. I get the sense from various aspects of this guy's story that he's shipping executables to end users, which makes this "solution" a non-starter. You can't expect the user to go in and mess with these sorts of options just to run your program, and I wouldn't feel comfortable changing something like this automatically during install since it is such a fundamental OS setting (not to mention testing the installer against all versions of Windows would then become a nightmare you'd have to redo every release).