- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
While the documentation says that one should set enough memory by a "\\FXXX" bytes, it doesn't give an idea as to
how much memory needs to be set. This program can be circumvented by setting an arbitrarily large memory like 200MB.
When the compiler returns the executable, and it is run, it starts the calculation but quickly returns with error
code 157 indicating that there has been a memory access violation.
It may be noted that in other compilers, there is a way to set the environment for a large model.
1. How does one indicate such large model to this compiler?
2. How to circumvent this error?
3. Does this error have anything to do with the settings in windows?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Windows does not have the concept of a "large memory model" the way Linux does. On 64-bit Windows, you automatically have up to 8TB of virtual address space for dynamically-allocated memory, but the same 2GB static code and data and 1GB stack limit of 32-bit Windows. For more information, see Memory Limits for Applications on Windows.
However, I don't think this is relevant to your case, as you would see different errors if you were exceeding the 2GB static limit.
The access violation can have many possible causes - I suggest you start with Don't Touch Me There - What Error 157 is trying to tell you on the topic. I suggest you look at either the traceback or, preferably, where it stops in the debugger, to find out where exactly the access violation occurs. This may give you a clue as to the cause. If you aren't already, I recommend building a Debug configuration in Visual Studio or use /check:bounds and /warn:interface when compiling.
Can you show us the actual text of the access violation error? The PC and address themselves can often be a clue.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page