Problems in Windows Vista
am 04.12.2007 23:18:25 von daveWe have an application developed for .NET 2.0 that has been working a
long time on Windows XP. However, when we put it on Vista, we get all
sorts of "Out of Memory" and "Access Violation" exceptions when trying
to open the program. I upgraded to Vista on my development machine,
and I get the same errors, only it shows up on different lines of code
every time, rather than particular places. I have no idea what's going
on. I have plenty of free memory. Sometimes, and here's the kicker, it
will open just fine and work for days on end, and then closing it and
reopening spawns all sorts of these issues.
Most of this is not my code, and it definitely has some design
problems that I'm attempting to resolve bit by bit, so it could never
well be the very structure of the program. It uses a lot of global
variables and static classes to do its work, so memory management has
to be poor anyway. But still, it works fine in XP, and horribly in
Vista, so I'm thinking there has to be a change in how the heap
operates or something to that effect.
Some things that are bad design that I'm currently in the process of
changing:
- Overuse of static classes and variables
- Using exceptions to pass messages to the caller
- Where tried and true design patterns would make sense, hundreds of
lines of spaghetti code is in its place
- Instead of modal forms, all functions are on controls that are late
bound to the main form, which changes context all the time.
- It was overall not written very well. I'm not the best by any means,
but this has been appalling to work inside.
I should also mention that it functions by calling a C dll for low-
level arithmetic. It seems to look ok from my end, by sending pointers
using the "ref" keyword, pre-allocating structures inside .NET before
the dll gets it, etc. However, interop is not my strong point, so the
problem could lie here I suppose.
Does anyone have some general ideas what could be causing such
behavior? Things I should look out for, ways Vista is different than
previous versions, etc.? So much for .NET guaranteeing compatibility;
it's not a Java killer for sure.