Urgent!! Please Help
-
No Sir!!! Iam not Creating Objects Dynamically.. and remaining resources iam properly deallocating.. So tell me should i create Dialog Object Dynamically so that i can delete memory explicitly... iam creating new dialog like this,, CMyDialog ss; ss.Domodal(); and further iam not doing any thing for memory deallocation. So how i can deallocate meomory for Statically created objects ..
Sounds like the other cause ...
Maxwell Chen
-
Sounds like the other cause ...
Maxwell Chen
-
dheka wrote:
Sir Can i use Smart Pointer for proper releasing of resource like memory..
Yes of course. But remember that smart pointers can also fall into unsmart under some specific conditions. Your situation may not necessarily be the resource free issue. I suggest you to profile the performance of your code (function level). In other words, to benchmark how long it takes for each major function implementations to execute.
Maxwell Chen
-
dheka wrote:
Sir Can i use Smart Pointer for proper releasing of resource like memory..
Yes of course. But remember that smart pointers can also fall into unsmart under some specific conditions. Your situation may not necessarily be the resource free issue. I suggest you to profile the performance of your code (function level). In other words, to benchmark how long it takes for each major function implementations to execute.
Maxwell Chen
-
No, you probably need a good Windows programming tutorial. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke -
No Sir!!! Iam not Creating Objects Dynamically.. and remaining resources iam properly deallocating.. So tell me should i create Dialog Object Dynamically so that i can delete memory explicitly... iam creating new dialog like this,, CMyDialog ss; ss.Domodal(); and further iam not doing any thing for memory deallocation. So how i can deallocate meomory for Statically created objects ..
dheka wrote:
iam creating new dialog like this,, CMyDialog ss; ss.Domodal();
Since your application is dialog based application, you are creating DoModal() to show up a dialog. showing up the dialog, are you creating new dialog, and so on. Is the dialog is getting stacked one on the other. When you are creating the dialog?
-
dheka wrote:
iam creating new dialog like this,, CMyDialog ss; ss.Domodal();
Since your application is dialog based application, you are creating DoModal() to show up a dialog. showing up the dialog, are you creating new dialog, and so on. Is the dialog is getting stacked one on the other. When you are creating the dialog?
-
Hi..No Iam Ending the dialog using EndDialog() Function. After Ending Dialog I dont know whether it still using memory or not. Can u tel me proper killing a Dialog after particular interval or event!! Plz..
dheka wrote:
Iam Ending the dialog using EndDialog() Function.
Since you are using
CDialog::DoModal
, you should end the dialog withCDialog::OnClose
.Maxwell Chen
-
Iam a Jr. VC++ Developer. Iam working on Dialog based application(MFC). My application is almost completed. It is typically a Billpayment sort of application. It works Fine for few Transactions but starts Slowing down and finally get hanged if i made several transaction of same flow.I have to restart my application again and so on. I cant find out the exact reasons of this. Iam created all my object statically. Is there any problem regarding statically or Dyanamically object creation. Please Tel me the reason, so that i get rid off soon.X|
Do you allocated data with
new
ormalloc
? If so, Are you usingdelete
orfree
to release the memory ? Are you communicating (transmitting) data somewhere ? on the network, in a Database ? in a file ? If you keep the data in memory, what happen when you add more and more data ? is it added in a "sorted" way ? (in debug mode) When you just do a couple of "transations", and quit, does the debugger report memory leaks ?Maximilien Lincourt Your Head A Splode - Strong Bad
-
Use the Windows Task Manager to see if you are releasing properly the objects you've allocated. You will see the "Usage memory" column of your program will increase very quick instead of being stable. That will help you to find memory leaks that could cause your program decrease in performance until hang it.
Demian. "I have always wished that my computer would be as easy to use as my telephone. My wish has come true. I no longer know how to use my telephone." -Bjarne Stroustrup, computer science professor, designer of C++ programming language (1950- )
-
dheka wrote:
Iam Ending the dialog using EndDialog() Function.
Since you are using
CDialog::DoModal
, you should end the dialog withCDialog::OnClose
.Maxwell Chen
HI Maxwell are you sure EndDialog() should not be used. please refer msdn for CDialog::EndDialog and implementation of CDialog::OnOK().
-
Hi..No Iam Ending the dialog using EndDialog() Function. After Ending Dialog I dont know whether it still using memory or not. Can u tel me proper killing a Dialog after particular interval or event!! Plz..
dheka wrote:
After Ending Dialog I dont know whether it still using memory or not
the class instance gets released after EndDialog and the local dialog variable. What about the resources used by the dialog class? You may have written code to release it. But are you sure the cleanup code gets executed? Debug the code, if it hangs, debugger shows the waiting statement if you pause the running application in the debugger. And you are doing some billpayment process, are handling connection to database correctly?
-
HI Maxwell are you sure EndDialog() should not be used. please refer msdn for CDialog::EndDialog and implementation of CDialog::OnOK().
Rajkumar R wrote:
are you sure EndDialog() should not be used. please refer msdn for CDialog::EndDialog and implementation of CDialog::OnOK().
You are right! It was my mistake. :-D
Maxwell Chen
-
Iam a Jr. VC++ Developer. Iam working on Dialog based application(MFC). My application is almost completed. It is typically a Billpayment sort of application. It works Fine for few Transactions but starts Slowing down and finally get hanged if i made several transaction of same flow.I have to restart my application again and so on. I cant find out the exact reasons of this. Iam created all my object statically. Is there any problem regarding statically or Dyanamically object creation. Please Tel me the reason, so that i get rid off soon.X|
I have few things to say. Check if you have any Memory profiler tools nearby available to you. Such as Rational purify or something else even one from codeproject. Run your code once. That will fix your problem. You will definitely get the location where u are going wrong. Have patience. I know its too hard, but its the truth.
-
Use the Windows Task Manager to see if you are releasing properly the objects you've allocated. You will see the "Usage memory" column of your program will increase very quick instead of being stable. That will help you to find memory leaks that could cause your program decrease in performance until hang it.
Demian. "I have always wished that my computer would be as easy to use as my telephone. My wish has come true. I no longer know how to use my telephone." -Bjarne Stroustrup, computer science professor, designer of C++ programming language (1950- )
Ya Sir1!Iam Checking it out in Task MAnager.ya iam getting problem in my second Dialog box..After Pressing cancel button in it,iam Ending that dialog using CDialog::EndDialog() function, but memory usage get increased tremendiosly.. So iam trying to poiint it out...Thanks
-
Do you allocated data with
new
ormalloc
? If so, Are you usingdelete
orfree
to release the memory ? Are you communicating (transmitting) data somewhere ? on the network, in a Database ? in a file ? If you keep the data in memory, what happen when you add more and more data ? is it added in a "sorted" way ? (in debug mode) When you just do a couple of "transations", and quit, does the debugger report memory leaks ?Maximilien Lincourt Your Head A Splode - Strong Bad