|
hi there!
i have a big problem with memory releasing in c#, let me explain u my case:
i have a sql class (sqlconnection+ sqlDataAdapter )which fill a DataTable that contains about 34000 rows, now the memory consumtion goes up about twice than before query executed! but the problem is when user closes the host form, memory would not be released compeletly! so after 3 or 4 time execution, application stopped working and out of memory exception!
I tried this solutions: Disposing Table- GC.Finalize- GC.Collect and so but they wont return whole of memory...
plz HELPPPPP
|
|
|
|
|
|
Well, it sounds like your DataTable can't be garbage collected. That indicates that you have a hard reference to it from outside the form that the user closed.
|
|
|
|
|
Learn how to use google:
Investigating Memory Issues[^]
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
Garbage collection is probably not the answer to your question. Something is most likely holding on to your references, making it impossible to collect as garbage, even if you call Dispose().
I would use a memory profiler to find out. CLR profiler is free and easy to use. It can be found at Microsofts website: http://www.microsoft.com/download/en/details.aspx?id=16273[^]
//daniel
|
|
|
|
|
Hi,
I want to understand the concept of the Join method.
When I use Thread1.Join() does it mean that Thread1 and the main thread runs simultaneously?
If not, I would be happy if you suggest me other method to do it
Thank from advance!
|
|
|
|
|
Thread.Join has nothing to do with making multiple threads run together - you can think of it as a mechanism where a parent thread can join to child threads and wait until they are finished. It blocks the calling thread and waits for the other threads to finish before it continues processing.
So, why would you want to do this? Well, if your parent thread completes processing faster than it's child threads then there would be trouble if the parent thread terminated leaving the child threads running, if those child threads had to access something on the parent thread.
There is no mechanism for guaranteeing that two threads will run simultaneously - the OS is responsible for allocating threads, your application must respect the rules given to it. Plus, of course, you can only have two or more threads running together if you've got a multi-core machine.
|
|
|
|
|
Are thre Mutex's that can be used in Silverlight?
It seems the Mutex examples I have seen work in window forms but not in silverlight.
In using System.Threading there does not seem to be a Mutex class in Silverlight.
|
|
|
|
|
There isn't a native Mutex available in Silverlight. There may be a third party implementation available on the web, but you will habe to search for that.
|
|
|
|
|
There is no support for Mutex in Silverlight.
Too much of heaven can bring you underground
Heaven can always turn around
Too much of heaven, our life is all hell bound
Heaven, the kill that makes no sound
|
|
|
|
|
Hi Everyone,
I am trying to figure out how to parse html line and take from it the $ sign and a the monetary value.
For example:
The price of the book is $15.00 and the price of the computer is $1,299.99 cents.
Thank you.
|
|
|
|
|
Please ask this in the Regular Expressions forum instead. We're trying to get the traffic up there. Forum[^]
|
|
|
|
|
Hi one hi all!
Using the example from , http://www.undisciplinedbytes.com/2010/06/html-5-c-web-sockets-server-and-asp-net-client-implementation/[^]
I have managed to add basic webSocket support to me TCP server engine. As I have very little knowledge in html and interested only on the sever side I came across few questions regarding the implementation of the WebSockets server:
1)Does the buffer of the handshake arriving from the client, always arrives in one chunk?
2)If not, how can I tell when I have all the handshake message?
3)I have change ‘ws’ to ‘wss’ (both in client and server) in order to use the secure option. As
a result the handshake from the client arrives (what seems to be) encrypted, how can
encrypt it? Where is the key?
Thank you all
|
|
|
|
|
I want to create a web service for a chat application which will instead of Request/response model use push model.
Client app will be notified of a new message, user logged in etc.. by the web service.
Does anyone have know where to start any good article with basic knowledge for creating such push web services.
|
|
|
|
|
I certainly don't; push is evil and never works.
My chat system uses pull. I still haven't yet converted it to use a Web Service.
One of the benefits of using pull is that it makes it easier to allow the client to poll at intervals of the user's choosing and to have a "check now" kind of button.
|
|
|
|
|
Agree to this poll model which is good but now a days client apps needs to be light and with growing numbers of client medium [mobiles, tables etc..] it is much better to let the server push the messages and client to listen. Something similar to push notification of Apple.
Do you have any articles on push web service?
|
|
|
|
|
nitin_ion wrote: it is much better to let the server push the messages and client to listen
No it's not. Trust me on this - I spent a lot of time working on a push application back in the late 90s, and the problems that had to be overcome are immense. With a push mechanism, you have to keep track of connected clients and track of what you have sent to the client. Suppose that you get a temporary network outage to a client and you push a message out, you need to track this and take some action based on this - for instance, you may allow a retry interval and then attempt to push the message again.
Remember that connections are finite resources, so you'd have to create a disconnected push mechanism which is a whole magnitude of complexity beyond. There are all sorts of tricks that you have to employ there.
|
|
|
|
|
Yes for most of the issue pull is better but there are some areas where push is better. like ads, alerts etc.
|
|
|
|
|
If you look at ad services (such as the one's here on CP), you'll find that the majority are based around pull mechanisms. Similarly, alerts are generally polled on web based systems.
|
|
|
|
|
There is nothing good about the push model, period.
Users will despise you, and waste tons of money on tech support to remove your nasty, intrusive application from their machines. People will revile you, and spit on your avatar in FarmTown, even at the expense of having to wipe their screens once in a while with a damp cloth. You will be a pariah in the realm of software development, and will never be invited to the really good hospitality suites hosted by top vendors at developer conferences, the ones where the booze and food are free, and served by scantily clad booth bimbos they rent by the hour from the local brothels. I, for one, refuse to buy any Adobe product because of their constant update notifications for their ubiquitous Reader product, and I despise Microsoft for their intrusive approach to installing inadequately tested patches that destroy perfectly functional machines, overnight. A pox on whoever conceived the notion of push products; may the fleas of a thousand camels infest his armpits, and may all the crabs in Las Vegas take up residence in his crotch.
Just don't...
Will Rogers never met me.
|
|
|
|
|
Web services are inherently request/response. If you really need push you should setup two way communications between your client and server or bring up web services on your clients and send from your server (reversing the process).
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.
|
|
|
|
|
It can't be done; as Mehdi says, web services are implemented on top of HTTP and are inherently request/response (i.e. pull) oriented.
Either you can do it with polling (some sort of intelligent polling that alters its frequency based on activity, if you want to be friendly to your server), or you can come away from the web service idea altogether and create a client/server connection based (probably TCP) chat application. There is simply no such thing as a push model web service due to the protocol on which web services are defined.
However, on any thin client (whether in browser or not) to a web service, you are sending quite a lot of requests anyway, onto which you can piggyback update notification information without adding extra server load. For example, imagining an online IRC type application, you are sending a request every time you type a message, change your status, look up information on another user, join or leave a room, as well as obvious things like following links. The trick is to include update notification (for chat messages, PMs, users in a room, etc) as part of every service response, if you want to minimise requests and still get frequent updates.
|
|
|
|
|
ok, but then how does push notification services work. aren't they web services?
|
|
|
|
|
|
can callback functions be used to see if a user sends message using request/response to webservice then web service should push that message to that user. something which is google doing
if we see in other messengers they do it using traditionally req/res but google , skype are using push for their messages.
|
|
|
|