|
Dave Kreskowiak wrote: Think about it, if you really were out of memory, how would there be enough memory to create an instance of the OutOfMemory exception object??
I'd expect a decent OS to reserve some memory and to give that specific warning before all memory is consumed, otherwise there would never be such a message (due to string-allocation).
Dave Kreskowiak wrote: Besides, how are you going to know what you did wrong to generate the exception??
We don't, but we handle the exception like any other; there's multiple ways a write can fail, yet it's hard to have the application "know" what it did wrong. Usually I display a message and let the user handle it. Most of the users recognize a "write failed", and check the file-attributes. Or the write-protection on the medium. Or their access-rights. Or whether the file is open.
That'd be my course of action in this particular case; the user might terminate some other app, like World of Warcraft, to free up valuable system-resources. I'd guess we both would display a message and write a note in the eventlog, as that's almost a default for the unhandled exceptions-handler
Bastard Programmer from Hell
|
|
|
|
|
Eddy Vluggen wrote: I'd expect a decent OS to reserve some memory and to give that specific warning
before all memory is consumed, otherwise there would never be such a
message (due to string-allocation).
True, a bad example on my part.
Eddy Vluggen wrote: We don't, but we handle the exception like any other; there's multiple ways a
write can fail, yet it's hard to have the application "know" what it did wrong.
He wants his code to recover from the failure. Chances are good an OutOfMemory wasn't caused by being out of memory.
Now, exactly what the circumstances are that cause him to look for this exception aren't known. It could be a genuine running low on memory case, but if his code is generating this exception and he doesn't know why, he's got much bigger issues that blindly trying to free up resources in his own code.
|
|
|
|
|
Dave Kreskowiak wrote: It could be a genuine running low on memory case, but if his code is generating this exception and he doesn't know why, he's got much bigger issues that blindly trying to free up resources in his own code.
That applies to more exceptions than only OutOfMemory, and my point was that we still handle it as if the machine is out of memory. A file-write exception might be caused by the hardware, I can't recover from that automagic either. You simply display the excuse that the OS comes up with and display that.
No, he doesn't need to free up resources, the user can do that by closing something else.
We're often thinking in terms of "handle the exception or rethrow it", where it would be more appropriate to let the user handle it.
Bastard Programmer from Hell
|
|
|
|
|
Eddy Vluggen wrote: That'd be my course of action in this particular case; the user might terminate
some other app, like World of Warcraft, to free up valuable system-resources.
That is phrased very badly or is just wrong.
Excluding a poorly configured (and non-default configured) windows OS a Net application will NOT run out of memory because of some other normal application.
That is also true for a unmanaged applications and also true for normal applications on any modern desktop OS.
Eddy Vluggen wrote: I'd guess we both would display a message and write a note in the eventlog, as
that's almost a default for the unhandled exceptions-handler
However many exceptions handled like that allow the user/app to continue.
An Out of Memory exception probably isn't something that should allow the app to continue. It certainly shouldn't be allowed to continue unless one considers carefully many possible error scenarios.
|
|
|
|
|
jschell wrote: Excluding a poorly configured (and non-default configured) windows OS a Net application will NOT run out of memory because of some other normal application.
I wouldn't expect it on a modern machine, but it can happen when your system is low on harddisk-space, since there's no place to grow the swapfile. Usually the system begins to crash when you're in that place
jschell wrote: However many exceptions handled like that allow the user/app to continue.
<layer>An Out of Memory exception probably isn't something that should allow the app to continue. It certainly shouldn't be allowed to continue unless one considers carefully many possible error scenarios.
True, anything "unknown" should cause the app to terminate; it's always better to rudely exit, than to continue with what could be corrupted data.
Bastard Programmer from Hell
|
|
|
|
|
Eddy Vluggen wrote: I wouldn't expect it on a modern machine, <layer>but it can happen when your system is low on harddisk-space, since there's no place to grow the swapfile. Usually the system begins to crash when you're in that place
None of which is normal and thus is not appropriate in the way the original statement was introduced.
|
|
|
|
|
jschell wrote: An Out of Memory exception probably isn't something that should allow the app to continue
I don't agree. Most Exceptions exist to tell you something is going wrong, however also to give you a chance to act upon the situation. There are a few others, more severe, say StackOverflow and maybe ShuttingDownByLackOfBatteryPower or some such.
If my app gets a FileNotFound, it either finds a way around that (maybe it has a list of alternative paths, of knows how to download the file again), or it asks the user for instructions, however it does not just terminate.
And if my app holds several algorithms to do something, and the preferred one fails with an OutOfMemory, it can still continue with the probably slower but less memory-hungry alternatives.
What I'm saying is an exception is only bad if you can't cope with it; if allocating a 10-character string fails, you're stuck obviously; when a request for a 100KB or larger object fails, your app may live on, chances are the user won't even know about it.
|
|
|
|
|
Luc Pattyn wrote: Most Exceptions exist to tell you something is going wrong, however also to give you a chance to act upon the situation.
Which I didn't claim otherwise.
However an Out of Memory exception does not fall into that category.
Luc Pattyn wrote: And if my app holds several algorithms to do something, and the preferred one fails with an OutOfMemory, it can still continue with the probably slower but less memory-hungry alternatives.
Nope. You are assuming that your 'algorithm' caused the exception.
You have threads 1,2,3 running three algorithms.
You also have thread X.
Thread X does something that causes an out of memory exception which shows up in thread 1.
Exactly what are you going to do in thread 1 in that case?
Luc Pattyn wrote: What I'm saying is an exception is only bad if you can't cope with it;
And what I am say pertains to an Out of Memory exception ONLY.
So your general comment means nothing.
Although your comment does not apply to all other exceptions either. For example a stack overflow exception.
modified 27-Oct-11 14:08pm.
|
|
|
|
|
Mehdi Gholam wrote: What is the best way to handle
It is possible that in the entire world there might be a single app where that is a good idea.
But it is unlikely to be yours.
And even more unlikely if you don't know exactly why the exception is occurring. And if the cause isn't an attempt to allocate a large array of primitives then unlikely also.
Best reason I have seen for accepting this is that there is no guarantee where an out of memory exception might occur. So, for example, even though you are allocating a 'bunch' of stuff in your thread the out of memory might occur in another one of your threads. Or even in a .Net internal thread.
|
|
|
|
|
Respected Sir/Friends,
i have 5 years working Experience with VB 6.0, but i am new in VB.Net, i developed my first Application in Hospital Management System but i have facing a problem with setup deployment, when i install my project on client computer, during the installation of DotNet Framework 3.5 sp, and display an error and setup close. I also used 3rd party software (Advanced Installer, Install Aware, etc)for its deployment but situation is same. so please help me and identify my mistake or step that i missed. and help me step by step deployment.
waiting for your kind response,
Regards
Yours Student
Love to Every One
|
|
|
|
|
Unless you explain what error you see, including the exact text of any messages, it is unlikely that anyone can guess what is going wrong.
|
|
|
|
|
I need to test my program on older machines.
How far do you think Mister Lambda is.
What is today's market share of Windows various flavour at home?
Do people still use Windows Me?
Do they have Windows XP with no service pack?
.NET framework 4 client requires Windows XP SP2, am I going to alienate my prospective client if I requires that too?
|
|
|
|
|
Pascal Ganaye wrote: What is today's market share of Windows various flavour at home?
There's a decent guess on the wikipedia[^].
Pascal Ganaye wrote: Do people still use Windows Me?
I know someone who does, yes.
Pascal Ganaye wrote: Do they have Windows XP with no service pack?
That happens.
Pascal Ganaye wrote: .NET framework 4 client requires Windows XP SP2, am I going to alienate my
prospective client if I requires that too?
The guy who's still on ME doesn't expect new software to run on his machine, and I doubt that he'd be interested.
Stick with the versions of Windows that you can get support for from Microsoft. Everything they don't support anymore (like Win95) needn't be on your supported-list.
Bastard Programmer from Hell
|
|
|
|
|
Pascal Ganaye wrote: .NET framework 4 client requires Windows XP SP2, am I going to alienate my prospective client if I requires that too?
Possibly, but you could find out what version of .NET your customer's system can handle and target your app to that version.
|
|
|
|
|
I was/am a PC modder for Oblivion and one thing that I was always amazed with was their modding tools. I never understood how it was possible to make a program that could be so easily managed by anyone who came along and decided to do so. I was intrigued by this notion and was thinking to apply it to software that I create.
All the programming I've been used to so far has had me creating code in my program for specific actions or instances, and creating premade interfaces... but I would like to learn how to create programs that can be easily modded by the end user (at least in the realm of visual appearance), while still being usable by me.
No matter how I look at it, it feels like this sort of programming direction needs to be decided at the beginning(not changed midway). Are there any articles that describe this sort of programming method or how to plan it before hand? Or can anyone give me any guidance towards this path? Anything would be helpful! Thanks!
- P.S. I'm not talking about this sort of programming method just for games, but just as a general approach to the subject. How to make a program that can be molded by the end user without losing any core functionality.
|
|
|
|
|
shingouki2002 wrote: at least in the realm of visual appearance
This concept is know as 'theming'.
A language like WPF will provide inbuilt support for themes.
ASP.Net provides themes as described here[^].
|
|
|
|
|
Hi,
I have a database which is running in one server. I have created an .exe(windows application) which is installed in client pcs. Shall I call this application as Client Server Application.
If the answer is YES, If I use the same .exe in the server where database is running, Shall I call that too as Client Server Application.
If the answer is NO, How do I call my application and introduce to the User? The user undserstand the application which comes thro' the webbrowser as Web Application(Internet or Intranet). Likewise how do I call it.
What is Client Server Application?
Thanks in advance,
|
|
|
|
|
If you have multiple instances of an exe running on various different machines (all clients) all connecting to a single machine (server), you are working on a client server application.
It does not matter where you put the exe. If you put the exe on the same machine where the database is, it would still be a client - server application. You are still connecting to the server using the client file.
Read more about client-server here[^].
|
|
|
|
|
I was wondering if anyone has had experience with implementing an algorithm in managed c++ and the same in c# and what the performance numbers were in comparison.
What I'm trying to say is do you get any performance benefits by implementing specific portions of your application in managed c++ when the need for that extra oomph is needed?
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|
|
I found this[^] article a great read.
If you are going to use typically managed constructs, looks like they would both be neck and neck in terms of performance.
Its really when you start using specific constructs would you need to compare the two languages.
|
|
|
|
|
Mehdi Gholam wrote: What I'm trying to say is do you get any performance benefits by implementing specific portions of your application in managed c++ when the need for that extra oomph is needed?
Almost always that answer to that is no.
If the application is slow then it there is a problem with the requirements, architecture and/or design. Correcting those can lead to orders of magnitudes of improvement. Given correct one can only improve parts of an application by small percentages.
As a specific example of that if you have a method that you call 1 million times a second are you going to to get more speed improvement by speeding up that method by 20% or by only calling it once a second?
|
|
|
|
|
Hi,
When i am tring to open solution in VS IDE.. i am getting message like "Microsoft VS 2010 has encountered a problem and need to close.We sorry for the inconvenience."..
i have reinstalled the Service Pack...then i got the same message
and also i have reinstalled the VS2010 premium...still i am facing problem...
can any one tell what might be the exact problem?...
Note :i am not using Laptop, i am using remote desktop...i haven't installed softwares...sevice is used to do so..
|
|
|
|
|
dayakar_dn wrote: can any one tell what might be the exact problem?...
No, but I can tell you how to find out. Use Event Viewer and see what VS writes to it when it can't load.
|
|
|
|
|
yes,the error message can be showed with event viewer.
i haved any problem settling with it
|
|
|
|
|
It may not be VS itself causing the problem. I have encountered this with Tool Extensions that are loaded. In addition to Pete's advice, try disabling any extensions.
No comment
|
|
|
|