IIS 6 / native memory question

S

Scott McFadden

When I run my 32 bit VC 8 DLL hosted by a managed C++ Winform APP on Win2003
32 bit with 4GB ram it runs fine. When I run the same DLL hosted under a
Managed C++ ASP.NET 2.0 Webservice project (also on Win2003 bit with 4GM
ram, the DLL fails). If i downgrade the box from 4GB of RAM to 2GB of RAM,
the DLL works fine under IIS.

What kind of issue is this? Is this an IIS limitation, a Windows
limitation, or VC limitation?

thanks

ScottM
 
C

Carl Daniel [VC++ MVP]

Scott McFadden said:
When I run my 32 bit VC 8 DLL hosted by a managed C++ Winform APP on
Win2003 32 bit with 4GB ram it runs fine. When I run the same DLL hosted
under a Managed C++ ASP.NET 2.0 Webservice project (also on Win2003 bit
with 4GM ram, the DLL fails). If i downgrade the box from 4GB of RAM to
2GB of RAM, the DLL works fine under IIS.

What kind of issue is this? Is this an IIS limitation, a Windows
limitation, or VC limitation?

Impossible to say without a much better description of "the DLL fails".

When the machine is configured with 4GB of memory, is it booting with /3GB?
If so, then it's possible that some address used by the DLL (could be code
or data) has an address above 2Gb, and that such a large address causes a
problem with some logic in the DLL. Such addresses will appear to be
negative numbers if accessed as an integer. (The possibility for such
errors is why there's a special linker flag /LARGEADDRESSAWARE to let a
process access user-mode memory about 2Gb).

-cd
 
S

Scott McFadden

Oops.. Calloc failures when running on Win2003 with 4GB ram.

So do I need to set the boot.ini flag and link with the /LARGEADDRESSAWARE
option or is one or the other sufficient?

Also, Got any links or info on Application Memory Tuning?

thanks!

ScottM

So I need to set the OS to boot with the /3GB switch and link with the
 
C

Carl Daniel [VC++ MVP]

Scott McFadden said:
Oops.. Calloc failures when running on Win2003 with 4GB ram.

I'm not sure what you mean - are you saying that you're seeing failures from
calloc with large memory? If so, that's certainly a bug - all of the
parameters to calloc are pointers or size_t, which is unsigned.
So do I need to set the boot.ini flag and link with the /LARGEADDRESSAWARE
option or is one or the other sufficient?

You have to use both the boot.ini flag and the linker option to actually get
access to >2Gb address space. If you're not doing that, then this probably
isn't your problem.
Also, Got any links or info on Application Memory Tuning?

Nothing jumps to mind - maybe someone else will have a nice collection of
links.

-cd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top