Click to See Complete Forum and Search --> : VC++ 5.0 MFC Memory Paging problem.I think!
KM
March 30th, 1999, 05:43 AM
Hi gurus,
I have been working on a project which involved many dialogs, classes and structures. So far so good, that is until now.
On exit of my program, it crashed with the standard error of "page fault". I narrow
it down to a structure , a small structure of only 15 byte of variables in total.
However, if i commented half the structure out, program runs perfectly. If I just add one extra byte in the above structure, program would crashed on exit.
Which seems to me like a memory paging problem....I think.
If indeed so, how do I increased the paging in MFC dialog environment.
If any of you knows or experienced similar problem, please help.
Thank you.
Dave Lorde
March 30th, 1999, 05:50 AM
It's more likely to be caused by writing to the wrong bit of memory using a bad pointer. It also sounds like the operation may involve copying the suspect structure...
Dave
KM
March 30th, 1999, 06:06 AM
Hi Dave,
Thanks for your prompt response. I neglected to mention that in my code, I have actually commented out the bit where the structure is used. So in fact the srtucture does not come into play while running the code. That is, the structure is merely declared but not used. Nevertherless, it still crashed the program.
I have proven this by commented out the structure. The program runs fine.
As I mentioned, if I uncomment half the structure, the program runs fine.
(Don't forget, during all this time the structure is not used in the running of the program). So pointer or copy of structure does not come into play at all.
What next........
Dave Lorde
March 30th, 1999, 06:24 AM
I don't know. If a bad pointer is writing to the wrong bit of memory, perhaps the additional memory allocation caused by your structure may shift stack or heap memory enough so it writes over a page boundary?
I would be very surprised if it turns out to be a system software bug rather than an application code bug. The change in behaviour caused by your changing your memory allocation sounds typical of an invalid write caused by a bad pointer or something similar.
Sorry I can't be more help,
Dave
Masaaki Onishi
March 30th, 1999, 04:03 PM
Hi.
If you think that OS has something wrong with its buffer and Paging capacity,
you can manually change them if you use Window NT.
Try to use Help of Window NT to know how we change them.
One more thing is that you use debugger your code even though your project is huge. I think that it is a short-cut to figure out your problem.
Hope for help?
-Masaaki Onishi-
KM
March 31st, 1999, 01:30 AM
Ohayo Mr.Onishi,
Thanks for your response. Unfortunately I am stuck with Window 95 OS.
I am not entirely sure if it is a OS problem. It could well be an MFS problem.
Thanks for your help anyway.
Sayunara.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.