|
I guess I would need a little more info. I am guessing this is a windows app? windows service? When you ran it on your box where you running via Visual studio? Or were you just running it via launching the exe. If you were running via VS that would take more memory. I am guessing that is not the case.
As far as why it uses less memory on your prod server, it might be because you are running sql server on the prod server. Sql server will more or less say this memory is mine you can't touch it. So you app might have used up more memory if it was allowed to.
So the fact that your app uses so much memory leads me to think that it is probably using virtual memory for what ever process you are running. So that means it is using hard disk space to page its ram memory. If you are using so much memory you start paging to disk like that, it can slow down a process.
Perhaps you are serializing large objects. I have found it is better to write the large objects to disk and clean up the files later, instead of just using RAM memory.
If you are using serialization stuff in sql server that is also slow especially the larger the serialize objects get.
Really it is hard to guess past that with out knowing more details of what you app is doing.
So there are a couple of stabs in the dark. Hope it helps.
Ben
|
|
|
|
|
Hi,
from the little you told us, I've got a feeling your app contains a busy loop
(i.e. a loop checking for something without including a delay such as Thread.Sleep)
and this loop runs many many cycles on a single-threaded CPU, whereas it gets statisfied
rather soon on a hyperthreading/multi-processor system. On the single-threaded CPU
Windows would assign most CPU cycles to the thread with the busy loop, and only few
are devoted to the next one or two ready threads; having more threading hardware would
give this/those other threads more opportunity to run, hence significantly reduce
the number of busy loop iterations.
If this is right, you should
1. look for the busy loop (might be as simple as while(someBool) {} )
2. and at least insert a delay in there, say Thread.Sleep(50)
which turns it into a polling loop (it no longer is a busy loop since it sleeps most of the time)
3. or better yet find a way to completely avoid the loop. The most appropriate way
would be to get the required synchronisation based on an event.
Hope this helps.
|
|
|
|
|
I have a database powered Windows application that uses Crystal Reports. Instead of loading a report that displays, say a list of all books that have been checked out, I would like the user to select the book title and then display the customized report. I have been reading a lot on discrete parameters, but I am unable to figure it out for some reason.
<br />
protected void SetParameterFields ()<br />
{<br />
ParameterFields paramFields = this.crystalReportViewer1.ParameterFieldInfo;<br />
ParameterField paramField = new ParameterField();<br />
paramField.Name = "book_name";<br />
ParameterValues curValues = paramField.CurrentValues;<br />
ParameterDiscreteValue discreteValue = new ParameterDiscreteValue();<br />
discreteValue.Value = "Huck Finn";<br />
curValues.Add(discreteValue);<br />
this.crystalReportViewer1.ParameterFieldInfo = paramFields;<br />
}<br />
<br />
Here "book_name" is a column in my database table.
When I display the report all records are displayed, not ones pertaining to Huck Finn.
What am I doing wrong and how do I correct it so I can get it to do what I need it to?
Thanks!
|
|
|
|
|
I can send a variable from Program.cs to Form1.cs by
Application.Run(new Form1(mode,fname));
How do I send a variable from Form1.cs to Program.cs
|
|
|
|
|
public string varForm1="Form1";
on form2 use value of variable varForm1
string varForm2 = varForm1;
I Love SQL
|
|
|
|
|
The method used depends on the intended use of the variable. If a certain action is to take place each time the variable changes, events are the way to go. However, if the variable is one that only needs to be checked once in a while, then you could use a read only property.
Phil
|
|
|
|
|
I have three buttons which set an integer called retInt in form1. In progam.cs I want to exit the program with return retInt;
Under vis2003 this was not a problem as I just declared static int retInt and it was seen in Main() and form1. Now that Main() is in program.cs and the buttons are in form1() I cannot pass the value of retInt from form1 to program.cs.
Forgive my stupidity but in C++ I would just declare a global variable and be done.
|
|
|
|
|
Sounds like the read only property is the way to go. Look up "Properties" in your help to see how they can be done. If you don't like properties, you could use a public static variable.
Phil
|
|
|
|
|
how i do code when i need a list of layers for each shape in order not to inference the other
|
|
|
|
|
I don't understand the question. What's a layer? What's a shape? Is this some sort of paint program?
More details please.
|
|
|
|
|
Hello,
im writting client/server application. I must create protocol to comunication between it. How it should look?
I thinging about something like that:
Class with data --> serialization --> Compression -->Encryption--> Sending
Receiving -->Decrypting --> Decompression - Deserialization
Is this good idea?
Greetings
|
|
|
|
|
That isn't a protocol. It is a description of dataflow between data transformation processes.
Other than that, it seems fine.
|
|
|
|
|
That architecture is going to take some time to send/receive. Does your serialization have to be compressed and encrypted?
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Yup, it must be compressed and encypted... Data are very sensitive, and there is a lot of it. Getting history for one user - 10k records takes something about 16Mbytes after serialization. When its compressed it takes only 400kbytes. System will be huge - something about 10k users.
Will be two types of clinet:
- which will send data to server, then server store it in database - 99% of users.
- which retrive and analyze data from server - 1% of users
|
|
|
|
|
And don't worry about the details. Also, web services can be configured to be compressed and binary as well.
File Not Found
|
|
|
|
|
class P
{
public void foo1()
{
Console.WriteLine("Inside class AA method foo1");
}
public void foo2()
{
Console.WriteLine("Inside class AA method foo2");
}
}
I can use the methods of this class "P" two way !!!!
1. I can inherit in a derived class like this way
class Q:P
{
}
Q q = new Q();
q.foo1();
q.foo2();
2. I can take an instance of class P in some class and I can expose the object of class P using some property ....
class R
{
P aa = new P();
public P Prop
{
get
{
return this.aa;
}
}
}
R r = new R();
r.Prop.foo1();
r.Prop.foo2();
My question is what is the pros and cons of this kind of method accessing technique!!!
When to use which one ?? Is there any difference between these two ???
Thanks,
Arindam D Tewary
|
|
|
|
|
Hi
I think there's no much difference. It is a type of organizing the code like parent child relation ship. Both method can access the public members. But using inheritance method will give a clear hierarchy of the program.
public class parent
{
//methods
}
public class child:parent
{
//methods
}
I think this will give a clear picture that child having parent properties.
|
|
|
|
|
Dear Navaneethkn,
Thanks for a nice reply. Indeed it was helpful.
Thanks,
Arindam D Tewary
|
|
|
|
|
Well, option 1 means that Q is derived from P. This means that it has access to protected methods in P. Consider the following:
class P
{
protected bool IsValid { get { return ... ; } }
}
class Q : P
{
public void Validate()
{
if (IsValid)
...
}
}
Now, you can't do the same with the following:
class R
{
private P foo = new P();
public void Validate()
{
if (foo.IsValid) ...
}
}
What you are seeing is explained using IsA and HasA relationships. In the case Q, we say that Q is a P - there is an implicit inheritance chain and Q has access to certain *exposed* portions of P. In the case of R, we say that R has a P - no inheritance chain, and no access to the internals of P.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Dear Pete O'Hanlon
Excellent !! I am sure this is what I was looking for .... and the way you have presented is awesome. Thanks a lot !!!!
Thanks,
Arindam D Tewary
|
|
|
|
|
What you use depends on what is logical in the relation between the classes.
Inheritance is used when the objects are basically the same. Like an airline pilot is also a person, so the class AirlinePilot would inherit from the class Person.
Class members are used when one object is a part of or a member of another. An airline pilot is not the same thing as an aeroplane, but rather a part of it, so the AirlinePilot object would be a member of the AeroPlane class.
---
single minded; short sighted; long gone;
|
|
|
|
|
Dear Guffa,
Thanks for a nice reply. Indeed it was very much helpful.
Thanks,
Arindam D Tewary
|
|
|
|
|
My MaintenanceLog table has an entry with following data in a row.
Name: Toney Mirra
ActualDateTime: 2007-02-16 12:55:02.867
PlannedDateTime: 2008-12-05 20:08:57.000
Comments: Sample Entry
But when I run the following query it doesnt return any value.
I think there is some problem in DateTime format. Can anyone help me fixing this?
select Comments from MaintenanceLog where
ActualDateTime = '2/16/2007 12:55:02 PM' and
PlannedDateTime = '12/5/2008 8:08:57 PM'
|
|
|
|
|
sks83 wrote: I think there is some problem in DateTime format. Can anyone help me fixing this?
Well, in general you should use the ISO format because it is culture neutral. YYYY-dd-MMTHH:mm:ss.fff
Your query doesn't work because there is no data that maches. Your ActualDateTime is 867 milliseconds out from what is stored in the database.
|
|
|
|
|
Could anybody help me please? Is there any way to displaying flash animations on C# forms?
jaye
modified on Monday, September 12, 2011 12:05 PM
|
|
|
|