|
Thanks Luc for you reply
Luc Pattyn wrote: 80KB seems rather big for a message
I also think so.
Luc Pattyn wrote: fragmentation, the topic of my reply, is not caused by the amount of memory currently in use, it is caused by how the number and sizes of memory blocks evolve over time
In that case if window service is idle for some time then why not garbage collector comes in picture and free the allocated memory
himanshu
|
|
|
|
|
I see you haven't really understood my point yet: the large-object-heap does not get compacted, i.e. when there are empty holes in the one huge memory block it manages, then the occupied blocks are NOT shifted to create one big empty hole; moving large blocks was considered too expensive. The net result is, you could have 2GB of memory filled with a pattern like this:
80KB in use
90MB free
80KB in use
90MB free
80KB in use
...
80KB in use
90MB free
80KB in use
90MB free
which means less than one percent is in use, and still you can't allocate a single 100MB block.
That is what fragmentation is about; and that is why "memory usage" numbers don't tell you whether the situation exists or not.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Your Service should be logging what method throws the Exception. You should be able to add more log messages like "I'm about to get a list of employees", etc. See if it's always the same action causing the problem (it may not be).
I write a lot of Windows Services, I don't keep a lot of data in the fields, mainly just database connections. Everything else is local to the methods in use so it gets garbage collected.
Review what data you keep in fields and rethink whether or not it needs to be.
|
|
|
|
|
Thanks buddy.....
Please look at my reply to Luc for futher clsssification of my problem.
himanshu
|
|
|
|
|
Hi,
I am placing horizontal scroll bar on the Panel and how to change the panel direction(left or right) according to the scrolling position?
Any sample code?
Thanks,
Palanivel
|
|
|
|
|
I think there is a possibility that you have misunderstood the purpose of a scrollbar. It is intended to move the content of a control, not the control itself.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Thanks for your reply Henry..
Exactly I want to move the contents of the Panel according to the horizontal scroll bar.
Any sample code..
|
|
|
|
|
If your need to scroll the content of the panel is because they extend beyond its boundaries, setting the AutoScroll property to true will enable its built in Scrollbars. Look up the AutoScroll , AutoScrollMargin and AutoScrollMinSize properties on MSDN for examples.
If there is another reason, it might help if you describe what it is that you are trying to do in more detail.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
In my windows application in C# i m getting error message as
-----
Debug Assertion Failed!
Program: C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO 2008\WindowsApplication1\WindowsApplication1.EXE
File: cmdtarg.cpp
Line: 52
For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.
(Press Retry to debug the application)
----
Can any one suggest me some method to remove this error
|
|
|
|
|
|
gauravems wrote: i m getting error message as
there is a diference between error and assertion[^].
gauravems wrote: Can any one suggest me some method to remove this error
maybe Check your call-stack at the assert (debug window), that might give a clue to where the objects reference count goes wrong
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Gud day everyone,
I want to upload files to an HTTPS site... the said site will ask a user name and a password upon opening the page. It will also ask another username & password when uploading the file...
problems:
1. my pc is behind a proxy server.
2. I did not find any solutions or sample codes to connect and upload into an HTTPS site. None of those samples I tried did not work or probably i just don't know how to use it.
3. I don't really understand the difference between HTTP and HTTPS except the latter will ask a username & a password.
4. I don't have a test HTTPS site because i don't know how to create one...
One time i encountered an error "System.Net.WebException The underlying connection was closed. Could not establish trust relationship with remote server."
Can i force the server to accept my certificate??? or do you have any solutions of my problems by all means.....
Hoping somebody can give thier brilliant solutions regarding this matter....
Thank you in advance....
xxx
modified on Tuesday, July 14, 2009 5:40 AM
|
|
|
|
|
The_Collector wrote: my pc is behind a proxy server.
How does that matter
The_Collector wrote: I did not find any solutions or sample codes to connect and upload into an HTTPS site. None of those samples I tried did not work or probably i just don't know how to use it.
The program does not change for a http or https site.
The_Collector wrote: I don't really understand the difference between HTTP and HTTPS except the latter will ask a username & a password
That not true. Https has nothing to with the authentication(i.e. asking for username and password)
Good explanation here[^]
The_Collector wrote: I don't have a test HTTPS site because i don't know how to create one...
You can create one like this[^]
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
regarding the making of a test server, i had read that link you provid but its totally deffrfent from what is n actual.... we have a windows server 2000 as our test server....
do u have a sample code as my basis???? i rerally need it badly...
thanks
xxx
|
|
|
|
|
HI,
to explain more... a popup window will appear like "http://www.zoneedit.com/auth/"
i'll be task to develop a program which will upload a file automatically on a given time without human intervention... I have d user & password but i dont know how to do it.... I made a lot of efforts but none is working...
below is my coding i used..
private void btnUpload_Click(object sender, EventArgs e)
{
try
{
System.Net.ServicePointManager.CertificatePolicy = new MyPolicy();
string uploadData = "user=" + TxtUser.Text + "&password=" + TxtPassword.Text; ;
ASCIIEncoding encoding = new ASCIIEncoding();
byte[] uploadByte = encoding.GetBytes(uploadData);
// Create the HttpWebRequest and set its properties
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(TxtSite.Text);
request.ContentLength = uploadData.Length;
request.ContentType = "application/x-www-form-urlencoded";
request.Method = "POST";
request.Timeout = 20000;
// Get a Stream from the HttpWebRequest and write login info to it
Stream uploadStream = request.GetRequestStream();
uploadStream.Write(uploadByte, 0, uploadByte.Length);
WebClient Client = new WebClient();
Client.UploadFile(TxtSite.Text, TxtFile.Text);
}
catch (Exception expx)
{
MessageBox.Show(expx.Message);
}
}
tnx in advance
xxx
|
|
|
|
|
Hi,
How would you make a video from a series of still images??
Any idea??
modified on Tuesday, July 14, 2009 5:44 AM
|
|
|
|
|
This thread [^]might help you.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Hi,
I want to generate 0's and 1's in the sequence like "0,1,0,1,0,1,0,1"....
I Used,
int returnValue = RandomNumber(0, 2); generates random numbers excluding the max .
But still i am getting all ones like (1,1,1,1,1,1,1,1). How to get 0's and 1's alternatively...
|
|
|
|
|
private string GetSequence(int PiNrOfTimes)
{
string _result = string.Empty;
for (int _count = 0; _count < PiNrOfTimes; _count++)
{
if (_count % 2 == 0)
_result += "0,";
else
_result += "1,";
}
return _result;
}
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Thanks Manas it works well.
|
|
|
|
|
Hi,
why are you starting a new thread? Your question today is what it was yesterday.
and did you make sure to use only one Random() generator as I told you then?
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
He seems perfectly happy with the other reply that's not random in the slightest
|
|
|
|
|
Yeah, I wasn't absolutely sure his example was generated at random either.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
I have decided to try to follow a dream of mine: Creating a chessprogram that can beat me (that should not be difficult).
I am lost before I have started, because basically I want to do a nice UI, where I can move pieces with the mouse.
I want to do everything my self and only one hints and links to ressources where I can learn.
My first question: How to make the board in the best way?
Thanks
Søren
|
|
|
|
|
nerosdk71 wrote: I want to do everything my self and only one hints and links to ressources where I can learn.
You can use WPF to create a nice UI for your dream program.
Try to google tutorials on WPF. In fact, you can also start with the available articles here at CP.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|