|
This is more of a Muse than an actualy question, but answers would be welcome.
I find occasionaly that i may use an object for a short period of time and after that, never want to use it again. It seems a waste to let something go through the full GC process, when i could kill it there and then.
An example would be a StreamReader that i use to read an input stream. It only exists in the scope of the function, and at the end of that it will no longer be needed. If it existed I could just call GC.Kill(reader) and be done with it.
What are peoples thoughts on this?
Tris
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
Why don't you Dispose it?
|
|
|
|
|
I didn't mean disposable objects specificaly (Perhaps streamreader was a bad example).
I'm just wondering why there is no option to destroy objects that you know you have no further use for, rather than cluttering up the GC.
T
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
It's already cluttered up to death anyway. All strings are immutable objects. String manipulations create and destroy lots of small objects, that just hang around until the GC gets around to collecting them.
It's a nice idea on paper, but it also introduces problems that can't be fixed until the next GC, like memory fragmentation. The GC maintains the managed heap, compacting memory when it can and when it needs to. It's performance is also self-tuning. Having you just kill and forcibly collect any object you want just destroys the ability of the tuner to do it's job.
Your idea is actually introducing the ability to create more clutter for the GC, not less.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Ah, i see.
It was only a technical daydream, i just wondered why it wasn't done
Cheers
Tris
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
Because the GC never needs to visit dead objects (it only visits alive objects). So, you could easily implement a GC.Kill method all by yourself like this:
class GC
{
void Kill(object o)
{
}
}
See? Easy
|
|
|
|
|
Hullo,
IS it possible to build applications on .net and run them on a a freeBSD,linux or any other open source OS.
If so? To what degree would this work?
cheers
Waskira
The level of your experience depends on your view
|
|
|
|
|
Try the Mono Project.
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
I tired that one time. Took me weeks to get it working right on my Fedora Core 6 box and then it was still... I dunno'.. odd feeling...
|
|
|
|
|
Check out the Mono Mono[^] project.
It is not 100% feature complete when compared to the Microsoft .NET Framework, but it is pretty close.
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
And they are playing serious catch up, so although it will unlikely ever be feature complete with the latest .NET version, it will probably be very close to 2.0 soon, an that's quite usable.
|
|
|
|
|
Is there a way to run a native Windows application if .NET is not installed on the target machine?
There was a way to do this with MS-DOS and Windows applications, by attaching a stub[^] application to the main executable. Then, if the application was launched in MS-DOS, the stub would run instead, usually providing a suitable error message.
Does something similar exist for .NET 2.0?
|
|
|
|
|
No the .net framework must be installed.
Ben
|
|
|
|
|
The .NET Framework must be install for the app to work.
You could create a stub, written in unmanaged C++ that MIGHT work, but I haven't heard of anything available or anyone writing one.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Dave Kreskowiak wrote: You could create a stub, written in unmanaged C++ that MIGHT work
Yes, but how?
The MS-DOS stub was trivial - it was just a one line .EXE that told you to go get Windows. It was added at link time by the /STUB linker argument. I can't find any documentation (apart from vague references to statements like ".NET will contain a win32 stub...") on how to do this - or even if such a thing is possible!
|
|
|
|
|
I have no idea. Because of the very specialized mature of what you want, I'd suspect that examples are going to be few and far between.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Could you not write an unmanaged C++ launcher, that checks if .NET is installed and if so runs the app, and if not gives a simple dialogue that informs the user to install it?
|
|
|
|
|
I think that stub will be there in the assembly. Try running a .net executable from MS-DOS. It will throw you the same old error message(This program can...)
Cheers,
Suresh
|
|
|
|
|
I think the difference here is that just because you are running in a dos shell the windows operating system was still installed. In this case we are taking about something that is not installed. There are three core dlls that run the .net framework. Without these a .net app will not run.
Ben
|
|
|
|
|
Hello ,
I am new in coding with c++ on the cisual studio 2.0 framework can someone help with this code , i am trying to implement clicking an exit button and calling the message::show function i get error message
Yes' : is not a member of 'System::Windows::Forms::Form::DialogResult'
private: System::Void exitButton_Click_1(System::Object^ sender, System::EventArgs^ e)
{
if(MessageBox::Show("Are you sure you want to exit this program?", "Close Application!", MessageBoxButtons::YesNo, MessageBoxIcon::Question) == DialogResult::Yes)
{
Application::Exit();
}
else{
return;
}
d
|
|
|
|
|
I think that should be DialogResult::OK .
|
|
|
|
|
Hi all..
I have two dropdown list boxes in an aspx page to which i have to load items from the database..When i run the application i am getting the following error...
Auto- attach to process '[3236] aspnet_wp.exe' on 'machine 171' failed
Someone help in this regard..very urgent..
Regards,
Balaguru
|
|
|
|
|
|
I require a software component to be added to an existing .net application(web based). The coponent or the software should posses the following features:
1. It should provide PC to Phone integration either on VOIP technology or TAPI or both.
2. It should provide automated phone dialing from phone number lists.
3. Transfer calls to other users internally.
4. Record conversations and provide automated call reports and statistics.
5. Every phone number in the system should be automatically clickable and the call details must be logged to that user.
6. The phone call must be recorded and stored as a sound file.
Can anyone help me to find any freewares or commercial products available in the market which can provide me the above features.
Thanks in Advance
----------------------------------
where there is a will there is a way
|
|
|
|
|
NasimKaziS wrote: require a software component to be added to an existing .net application(web based).
You want a "component" to do all this? Something that would be normally found in a suite of applications??
NasimKaziS wrote: Can anyone help me to find any freewares or commercial products available in the market which can provide me the above features.
This is something you would probably require an entirely new phone system for! I seriously doubt you're going to find an all-software solution to this.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|