While trying to reduce the RAM footprint of my program, I found that the HDC (printer device context) never releases the memory it allocates. Is there a way to free up the 4 megabytes of memory used by the CDC?

I've included sample code with comments below. I'm running on XP Pro, so some of the things I do may be specific to NT/XP programming.

/////////////////////////////////////////////////
HDC hdc;
char szName[256];
GetProfileString(TEXT("Windows"),TEXT("Device"),_T(",,,"), szName, sizeof(szName)); // Get default printer info

CString strTmp = szName ;
if (strTmp.Find(",") > 0)
strTmp = strTmp.Left(strTmp.Find(",")) ; // Parse out the printer name

// The CreateDC() call consumes 4 megabytes of memory...
hdc = CreateDC(NULL, strTmp, NULL, NULL) ;

// Code to do printing goes here

// Try to get rid of the hDC and it's memory...
DeleteDC(hdc) ;

// At this point I'm still out 4 megabytes of memory - and it is never recovered until the program exits.
// I've also tried using PrintDlg() and the MFC equivalent CPrintDialog() to get a DC. Same problem with memory in all cases.