Thursday, July 11, 2002


.NET CLR Large Heap Allocation Bug

I got bit by this nasty one today!  We have a web service that we use to update items in our database.  One of our developers was working on attaching images to records and got nailed with this bug.

He was sending a 5 MB attachment in the dataset as a blob.  At first the Web Service wouldn't even accept the request.  We realized we needed to increase MaxRequestLength in the machine.config beyond the default of 4096KB to allow the Web Service to get the request.  When we did we found the aspnet_wp.exe process would ballon to over 300MB at which point it would hit the 60% process model limit and restart the worker process!

We decided to run some tests and created a web service that looked like this:

[WebMethod]

public string Test(string strData)

{

return strData;

}

We then called this Web Service with a client that varied the strData sent in from 1MB to 10MB.  We found the following:

Payload Size Bytes

Managed Bytes

Mem Usage Kilobytes

Managed Change

Mem Usage Change

 

2510430

24,696

 

 

1048576

19287617

43732

16777187

19,036

2097152

16410643

67172

-2876974

23,440

3145728

20203539

82116

3792896

14,944

4194304

31475731

121240

11272192

39,124

5242880

35641363

137432

4165632

16,192

6291456

39708691

137584

4067328

152

7340032

13158791

172476

-26549900

34,892

8388608

 

Recycled the aspnet_wp.exe process

 

 

 

From what we can tell on average for every 1MB of extra data we threw at the Web Service aspnet_wp.exe chewed up an extra 15-20MB of memory.  On a 512MB machine this meant we could process a 7MB request max before restarting the worker process.  Note this is with only 1 request hitting the machine.  In production this would be deadly.

Asking around I was told this is part of the large object heap memory allocation bug that exists in version 1.0 of the CLR.  This bug is further documented here: Whoa - GC incorrectly handles large freed objects


4:46:47 PM    

Content Management Server

Microsoft finally figured out how to solve their pricing issues with Content Management Server.  It was originally priced at around $40K per processor.  CMS 2002 is now priced at: Pricing varies based on deployment scenario.

IOW they took so much crap for their previously insane pricing they aren't even going to publish it this time around.  You have to call them to figure out if you can afford the software. 

Come on guys.  I think this is definitely a place where there is a big need in corporate america but you have to price it down into the realm where it doesn't take a major budgetary line item just to get it purchased and installed.  Start thinking down in the couple of thousand dollar range where you price Win2K Server et. all.


4:27:05 PM