📄 memleak.aspx
字号:
<%@ Import Namespace="System.Diagnostics" %>
<%@ Import Namespace="System.Text" %>
<script language="VB" runat=server>
Sub Page_Load(Sender as Object, E as EventArgs)
Dim i As Integer
Dim garbage As New StringBuilder
If Application("garbage") Is Nothing Then
Dim c As Integer
For c=1 to 1000
garbage = garbage.Append("xxxxxxxxxx")
Next c
Application("garbage") = garbage
Else
garbage = Application("garbage")
End If
For i=1 to 500
' Make sure we create a unique entry
Application(i.ToString + DateTime.Now.ToString("r")) = (garbage.ToString() + DateTime.Now.ToString("r"))
Next i
Dim p as ProcessInfo
p = ProcessModelInfo.GetCurrentProcessInfo()
ProcessID.Text = p.ProcessID.ToString()
End Sub
</script>
<html>
<body>
<h2>The Process ID serving this request is: <asp:label id="ProcessID" forecolor=red runat=server/> </h2>
<h2>There are <%=Application.Count.ToString()%> items in Application state memory.</h2>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -