|
Where to begin...
I am responsible for a .net web application (vb.net) that I just converted to 2.0 from 1.1. The conversion was just one component of the changes involved in the current version, but it was the primary one. I have recently begun doing some stability and memory profiling tests and I am observing an alarming trend. I am really hoping someone can help me to understand how to best approach my problem.
I have created a testing environment with a server running ws2k3 and another system as a loadgun running an act script. When I apply load to my app for a number of hours it seems as though the memory consumption just keeps on rising and rising. I haven't seen it plateau as I expected to.
My app is divided into a front-end and a back-end component. These run on different servers in the production environment, each of which is running in its own application pool on the same server in my test environment. I am monitoring the consumption of memory by the app using perfmon on the server, and the following counters:
"Process.Private Bytes" (for the w3wp process)
"Process.Private Bytes" (for the w3wp#1 process)
".NET CLR Memory.#Bytes in all Heaps" (For the w3wp process)
".NET CLR Memory.#Bytes in all Heaps" (For the w3wp#1 process)
If I'm way off base with the counters to use here, please let me know. I'm the first to admit I'm at the foot of a steep learning curve here.
I was initially hoping to see the memory consumption flatten out after running the app for a short time. When that didnt' happen I added the #Bytes in all Heaps, hoping to see if the garbage collector was keeping the size of the Heaps down. I thought I could tell if the problem was with an unmanaged memory leak, or just the CLR's tolerance for memory usage being really high in .net 2.0 as opposed to 1.1. What I've observed is that both counters keep on rising and rising.
I haven't been able to kill the server with memory consumption yet, because my test database kept running out of space and stopping the test, but I've increased the space in the db, and am now running the test again for 16 hours. I am about 4 hours into the test, and the memory consumption shows no signs of flattening out.
I don't have the luxury of much time to try and figure out what's going on. Due to other issues, I wasn't able to start these tests until way too late in the development cycle, and now I'm stuck.
I know my post is probably already too long, but If anyone can help by giving me some ideas or direction. Or help me to understand what is going on enough to start affecting the behavior I'm observing.
I tried downloading the CLR Profiler, which dumps out a 500Mb log file that I don't really understand well enough to extract value from it. I've been reading lots of articles, but I can't find any info that will give me the ability to bite into my problem.
I'm on my own trying to solve this, and I'm not sure what the best way is to use the limited time between now and my approaching deadline.
This problem really has me on my heels. Any help or direction is appreciated.
|
|
|
|
|
AFAIK, this is the way it's supposed to work - mainly cos it needs to maintain sessions until they timeout.
Luckilly, once aspnet_wp / w3wp process will recycle once it reaches a defined limit
Nothing to see here - move along lol
"Knock me down, I'll get straight back up again, I'll come back stronger than a powered up pacman"
(Lilly Allen / Kaiser Chiefs)
|
|
|
|
|
Where is this value defined for IIS6 & .NET 2.0?
For .NET 1.1 the memory limit was defined by percentage in the memorylimit attribute of the process model machine.config tag.
The .NET 2.0 machine.config has no memorylimit attribute of the process model tag.
Just to clarify, are you suggesting the memory is supposed to ramp until the w3wp process restarts to clear it?
|
|
|
|
|
I have an asp.net website I am designing using VS2005 standard. It is installed on Win2K3 Enterprise.
In a Wizard Control, I want to take user input from two textboxes, add them together, and then display the results in a label when the user clicks a button.
I am using VB.
Here is an example of what I'm trying to do:
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim TextBoxOne As TextBox = Wizard1.FindControl("TextBox1")
Dim TextBoxTwo As TextBox = Wizard1.FindControl("TextBox2")
Dim LabelOne As Label = Wizard1.FindControl("Label1")
LabelOne.Text = (CDbl(TextBoxOne.Text) + CDbl(TextBoxTwo.Text))
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Wizard ID="Wizard1" runat="server">
<WizardSteps>
<asp:TemplatedWizardStep ID="Test" runat="server" Title="Test">
<ContentTemplate>
<asp:TextBox ID="TextBox1" Text="0" runat="server"></asp:TextBox><br />
<asp:TextBox ID="TextBox2" Text="0" runat="server"></asp:TextBox><br />
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label><br />
<br />
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /><br />
</ContentTemplate>
</asp:TemplatedWizardStep>
</WizardSteps>
</asp:Wizard>
</div>
</form>
</body>
</html>
Thanks in advance,
JTok59
|
|
|
|
|
Hey man
Got same prob here. Just solved it. Look in the post before to track my progress on the same prob. but heres the cmd to get the values out using vb:
Dim CodeTextBox As TextBox = Me.CreateUserWizardStep1.ContentTemplateContainer.FindControl("CodeTextBox")
cheers
dev
|
|
|
|
|
Thank YOU! I really appreciate it. I read your post, but apparently I didn't make the connection that it was the same problem.
It worked like a charm!
|
|
|
|
|
Hey man
I have given you the line how to get a control from code behind, but here is the line to commit data back to a control from code behind. This example sets the text of a text box inside the createuserwizard in the aspx page using a code behind command:
CType(Me.CreateUserWizardStep1.ContentTemplateContainer.FindControl("AllowNext"), TextBox).Text = String
Hope those help. Check out the previous thread where i was having the same prob for greater detail.
Cheers dev
|
|
|
|
|
I was also able to commit data back to a label by making it equal to the asp.net label first. (My grasp of these things is more limited than I'd like, but I think this is an alternate method.)
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim TextBoxOne As TextBox = Me.Test.ContentTemplateContainer.FindControl("TextBox1")
Dim TextBoxTwo As TextBox = Me.Test.ContentTemplateContainer.FindControl("TextBox2")
Dim LabelOne As Label = Me.Test.ContentTemplateContainer.FindControl("Label1")
LabelOne.Text = (CDbl(TextBoxOne.Text) + CDbl(TextBoxTwo.Text))
End Sub
Thanks Again,
JTok
|
|
|
|
|
Hi there
I've been working on this problem for ages now and it makes no sense. I have a create user wizard and wish to put variable within it, the problem is that i cannot for some reason see these variables from the code behind file. Below is a basic example of the aspx file:
<asp:CreateUserWizard runat="server" ID="CreateUserWizard1" AutoGeneratePassword="False"
ContinueDestinationPageUrl="../GeneralForms/Default.aspx" FinishDestinationPageUrl="../GeneralForms/Default.aspx">
<WizardSteps>
<asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server">
<ContentTemplate>
<b><asp:textbox runat="server" id="txtTest"/></b>
</ContentTemplate>
</asp:CreateUserWizardStep>
</WizardSteps>
</CreateUserWizard>
Now the bolded text box for some reason cannot be seen by this web pages code behind file. Does anyone know why or have a solution.
Thank you so much in advance for any help. I'm going CrAzY!!
Devin
|
|
|
|
|
When a control is inside a template, like the wizard template, or the columns of a gridview, the control that contains it, often creates it many times. Therefore, it's not visible in the code behind, because it may not be a single control. You have to interact with the wizard control itself, perhaps with the findcontrol method, to find the controls that are inside the wizard control, but, ideally, each contenttemplate should be a single control, which, in itself, interacts with all it's controls in whatever way it needs to, to work properly.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi there
Sorry to be an inconvenience, but would u mind popping my code i write into a blank aspx page, and see if u can get to the control placed in it. As i have tried to do your suggested method prior to posting and to no avial. Maybe should u be able to find the control then i could c the long command u used to do so.
Thanks again for any assistance. Nearly 5 hours gone and im still battling...
Dev
|
|
|
|
|
To be honest, I've never used the wizard control, but I recognise the problem, having dealt with it using templated controls. Using the grid view, when I work on a specific row, I get given the row, and I can call the FindControl method to find the instance of the control in the row.
Why do you need to access the control ? Is there no way you can make the control self contained ? If your control has events, you can hook those to methods in the main page using the aspx.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hey Christian
Well i'm trying to include a CAPTCHA into the signup process before user is committed to the database, and thus need to include it in this step. However since your last post i have made ground throught the line:
Dim CodeTextBox As TextBox = Me.CreateUserWizardStep1.ContentTemplateContainer.FindControl("CodeTextBox")
This has allowed me to get values of controls within the page! YEY But now my problem is im trying to find the command to set values back into the controls on the page. Any ideas on this one?
Thanks again for the help...
|
|
|
|
|
SOLVED!!! YIPEE
Here's the line to send something back into a web control programatically. The example im pasting sets the text string for a textbox control programatically. While in the previous post is pasted the line to get a web control from code behind if its hidden.
CType(Me.CreateUserWizardStep1.ContentTemplateContainer.FindControl("AllowNext"), TextBox).Text = ToString
This is just incase anyone is suffering the same problem i have endured! Hope it helps...
Cheers
Dev
|
|
|
|
|
I would like to create a data grid that has a column, where in a given row, there is sometimes a button and sometimes plain text. (The decision between button\text will be based on the string in the column of the given row.)
Can this be done? What type of column should I use?
DWreck
Dwreck
|
|
|
|
|
One solution would be to have both the button and text controls in a TemplateColumn, and set the Visible property of each control depending on the value of your string in the ItemDataBound event.
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
Hi,
Does anyone know what this following regular expression would interpret as?
Regex re=new Regex("((?<field>[^\",\\r\\n]*)|\"(?<field>([^\"]|\"\")*)\")(,|(?<rowbreak>\\r\\n|\\n|$))");
Many thanks for your time.
|
|
|
|
|
((?[^\",\\r\\n]*)|\"(?([^\"]|\"\")*)\")(,|(?<rowbreak>\\r\\n|\\n|$))
Basically (...)s create a group which can be retrieved later from the results if it has a (?...) then it is simply used as grouping in the regex and is not output to the results.
Pattern 1: The 1st bracket then is looking any characters bar for a quote (") followed by a comma (,) and carriage return / line feed (\r\n). It wants one or more of these consecutively.
Pattern 2: The 2nd bracket is looking for any characters except a quote or a two quotes, again matching zero or more of these consecutively.
Pattern 3: The 3rd bracket(s) are looking for a comma or (a carriage return, line feed or a new line or the end of the string).
So in summary it's matching Pattern 1 or a quote followed by Pattern 2 and 3.
Hope that explains it a bit, it's quite difficult to put into words, just remember that brackets act like grouping constructs like in any programming language, except here unless they have a ? following the opening parenthesis (? then the group is output into the results.
|
|
|
|
|
It is comma delimited csv file that is being read. To change the comma to a tilda(~) delimited file, would changing in those two places a comma occurs to tilda work?
Thanks.
|
|
|
|
|
Hi everyone:
I'm new in .net web programming, and I really need help on this, because i have to finish this work by next week, and by now, I am getting desperate!!!! My issue is that I have a web site, kind of a point of sale (POS), but I need users to print tickets on their local printers. I dont know how to do this, since my app doesn't "see" any network printer. I am printing directly to the printer, not using any reports. Please I would really appreciate any solution, even any suggestion on how to make it better. Thanks in advance...
|
|
|
|
|
Just generate a simple HTML "report" and then you can use javascript or tell them to print the page themselves. That's what everyone else does.
|
|
|
|
|
You can't see their printer, you can't see anything on their PC. You can give them a form to print, but you can't know they will print it, or even that they have a printer.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
I have two apsx pages. In the first aspx page I have one gridView and a linkbutton under gridview. When the user clicks on LinkButton it will take you to the next aspx page. In the second aspx page I have 2 text boxes and one button Insert. The user enter some data into text boxes and clicking on Insert button will take him to the first aspx page and fill the textboxes data to Gridview.
In the first aspx page my code is like this:
Page_Load()
{
GridView1.DataSource = (System.Data.DataTable)Session["dta"];
GridView1.DataBind();
dta = (System.Data.DataTable)CreateDataTableA();
if (!IsPostBack)
{
Session["dta"] = dta;
}
}
//This is for link button click event.
protected void LBAddPartner_Click(object sender, EventArgs e)
{
Response.Redirect("PartnerDistrict.aspx");
}
protected System.Data.DataTable CreateDataTableA()
{
System.Data.DataTable aTable = new System.Data.DataTable();
DataColumn dtCol;
// Create ID column and add to the DataTable.
dtCol = new DataColumn();
dtCol.DataType = System.Type.GetType("System.String");
dtCol.ColumnName = "District_ID";
dtCol.AutoIncrement = false;
dtCol.Caption = "District_ID";
dtCol.ReadOnly = false;
dtCol.Unique = false;
// Add the column to the DataColumnCollection.
aTable.Columns.Add(dtCol);
// Create Name column and add to the table
dtCol = new DataColumn();
dtCol.DataType = System.Type.GetType("System.String");
dtCol.ColumnName = "District_Name";
dtCol.AutoIncrement = false;
dtCol.Caption = "District_Name";
dtCol.ReadOnly = false;
dtCol.Unique = false;
aTable.Columns.Add(dtCol);
return aTable;
}
In the second page:
//Insert button click:
protected void Button1_Click(object sender, EventArgs e)
{
dta = (System.Data.DataTable)Session["dta"];
DataRow dr = dta.NewRow();
dr[0] = txtboxDID.Text.ToString();
dr[1] = txtBoxDName.Text.ToString();
dta.Rows.Add(dr);
//Response.Redirect("Default.aspx");
Response.Redirect("Default.aspx");
txtboxDID.Text = "";
txtBoxDName.Text = "";
}
My problem is I the gridview (datatable) showing only the last inserted record only . WhereI mean in which event I have to put this line Session["dta"]=dta in first aspx page to persist all records.
Thanks in advance
|
|
|
|
|
The line doesn't matter, if it's in the session, it's in the session. If the data comes from your database, a better solution is to pass over an Id which can be used to reproduce the database query to get the data down again on your new page. Another option is cross page postback, and pulling the data out of viewstate.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Any ever have any trouble using an updatePanel with RadioButtonLists? I am getting it to update once without posting back to the server using async postback but once I click on the other radiobutton it doesn't run the same set of code again. If you know of any articles to read that would be great!
Thanks,
Cisco
|
|
|
|