1

We maintain a Web application which is basically a set ASP Classic pages loading COM Objects (through a homemade framework to avoid code duplication and excessive instance creation), running on IIS 6.2:

Dim stuffer: Set stuffer= CreateObject("StuffUtils.Stuffer")

Dim this: this= "this param"
Dim this: that= "this param"

stuffer.process this, that ' "Out of Memory" error occurs here

StuffUtils is a homemade .NET DLL with COM Interoperability and relies on a set of 3 huge DLL (purchased): a.dll (11M), b.dll (22M), c.dll (11M). The call above would be:

page.asp --> stuffer.stuff() --> c.dll calls and instantiations

The call stuffer.process() fails and the message Out of memory occurs, but only for one IIS installation (and, of course, the client's one, which is quite unreachable) and for one specific case (!). It's fine on ours. Also, if the dll is called from a command line application, it runs file even on the client server (in a CMD window).

I guess the error message might be related to the loading of those huge DLLs, however the error occurs at the method call, not at the server component creation. Did I miss an entry in the IIS configuration?

Amessihel
  • 5,891
  • 3
  • 16
  • 40
  • I guess IIS process is running 32-bit? have you checked the memory of that specific process. – Simon Mourier Jun 28 '19 at 09:18
  • @SimonMourier IIS runs in a 64-bit OS but the DLL is 32-bit. You mean I should check the process usage with the task manager ? – Amessihel Jun 28 '19 at 09:33
  • You can't have a 32 bit dll loaded in a 64 bit process. So it means your IIS process (w3p.exe?) runs as 32-bit. A real out of memory is very possible. – Simon Mourier Jun 28 '19 at 10:33
  • @SimonMourier, thank you. So I'll should check the memory usage. What do tool do you recommend? Moreover, is there a way to increase the memory limit? – Amessihel Jun 28 '19 at 15:47
  • Task Manager is the most simple (and quite inexact) tool. No there's no way, if you really have memory limit, migrate to 64bit, or tune your code. Google for "asp classic memory profiler" for example. – Simon Mourier Jun 28 '19 at 16:06
  • @SimonMourier The strangest part is that the DLL StuffUtils call won't raise an error if called from an homemade exe rather than from an ASP Classic page. – Amessihel Jun 28 '19 at 18:47
  • @Amessihel if its a 32 bit DLL and your OS is 64 bit you will need to set [`Enable 32 bit applications` to `True`](https://stackoverflow.com/a/5216263/692942) in the Application Pool advanced settings in IIS. – user692942 Jul 01 '19 at 16:25
  • Setting up the culprit DLL on its own Process by adding it to a COM+ Application gives that DLL its own independent 2GB address space. That might be enough to get you out of the problem. You might have to do it for all 3 DLLs (each their own application). But depending on what the DLL actually does, you might not be able to afford the performance cost of having the DLL run as Out Of Process, and some DLL might not work that way at all, so watch out for that. – Euro Micelli Jul 02 '19 at 13:29
  • @EuroMicelli, thank you for your reply. If I understand correctly, I should make a Stuffer COM+ application (instead of a Stuffer COM-Visible Dll) which loads the three DLLs and which is callable from an ASP Classic page. And of course this application have to be a .NET one to be able to load the three dlls. I found an [answer](https://stackoverflow.com/a/14234698/4375327) which leads to a [page](https://blogs.msdn.microsoft.com/codefx/2010/11/25/all-in-one-com-code-samples/) of a Microsoft blog listing some samples, but not (apparently) related to COM+ techno. – Amessihel Jul 02 '19 at 19:54
  • It has nothing to do with .NET. You can create a blank COM+ application from the Component Services Admin tool. In COM+ an Application is a set of COM+ settings. COM+ gives you a host process for free. Set the Application to “Server” type. Set the process Identity to something sensible. Probably disable Access Checks. Add the existing DLL that uses a lot of memory to the application. Don’t use one application for all three DLL or your going to be back to square one. Experiment some. If you’re not familiar with Component Services you’ll probably need to do some reading. But it’s worth a try – Euro Micelli Jul 03 '19 at 00:04

0 Answers0