C++ & O/S Woes

Author
Discussion

plotloss

Original Poster:

67,280 posts

277 months

Thursday 29th May 2003
quotequote all
MS Pain in the arse!

We use a CASE tool that generates C++ code. This code is then compiled with Visual Studio 6.0 under Win XP Pro.

When the resultant functions are executed under XP everything is fine, however, when the functions built under XP are executed under Win2K I have some serious memory problems. Win2K seems to be treating these objects as 9x objects because they just dont release the memory. A simple function this morning has eaten up 750mb of physical memory and I cant work out why.

Google, is rather oddly, providing to be no use at all...

Any clues?

I am thinking there must be some sort of compiler switch or incompatibility between XP and VS6.0. I could be way off the mark here though.

Don

28,377 posts

291 months

Thursday 29th May 2003
quotequote all
What sort of memory allocation function calls are you using? I found years ago that the Win32 Free calls didn't seem to work properly on all platforms!

Changed over to good old malloc and free and it all came good.

I'm not saying that's what it is...

Can you step the code in the debugger and trace the leak to a line of code..with that sort of memory loss I'd imagine almost every free() call (OK OK "delete" these days) must be failing....

Is the C++ MFC? Just some ideas...

Don

28,377 posts

291 months

Thursday 29th May 2003
quotequote all
Oh...any why not build it under Win2K and copy the resulting code to XP to see if the same thing happens....?

plotloss

Original Poster:

67,280 posts

277 months

Thursday 29th May 2003
quotequote all
Nice one Don, I'll look into that.

As I say though its generated so I am not sure what I am looking for (C++ may as well be Urdhu).

If we build under Win2K and deploy to Win2K everything is fine, but alas all my developers have XP machines!

Don

28,377 posts

291 months

Thursday 29th May 2003
quotequote all

plotloss said: If we build under Win2K and deploy to Win2K everything is fine, but alas all my developers have XP machines!


That could be a bit of a giveaway. How do you deploy the resulting code? Is the installation manually created or automatically generated? No matter - its the list of DLLs, OCXs etc that ship with the thing that you need to examine. If you get one of your guys to compare DLL versions of the output of a Win2K build and on an XP Build you'll find your different DLL. (Could be a few!) Once you know which DLLs/OCXs/Whatevers are causing the trouble you can eliminate each one in turn until the find the wee devil.

Oh the joys of MS development. Just thank your lucky starts you don't have to use VB Pile of steaming.

plotloss

Original Poster:

67,280 posts

277 months

Thursday 29th May 2003
quotequote all
Theres a proprietary framework that comes with the tool. The DLL's execute in that environment and that is the same under XP and Win2K the only difference in both the environment and the application (no install routine, DLL's moved manually) is the O/S.

I think I will try and resolve this until mid day and if I cant get any further CA cant sort it out, its their CASE tool after all