如何确定一个会话变量的内存占用? [英] How can I determine the memory footprint of a session variable?

查看:107
本文介绍了如何确定一个会话变量的内存占用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此外,web.config中 - 请解释

Also, web.config - please explain.

<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" 
cookieless="false" timeout="120"/>

我们正在使用进程内模式,我们用我们的Web应用程序的20会话变量。我们需要知道每个变量占用的内存空间。

We are using inproc mode and we used the 20 session variable in our web application. We need to know each variables Occupying the memory spaces.

推荐答案

从乔治牧羊人的ASP.NET常见问题解答的 http://www.syncfusion.com/faq/aspnet/web_c9c.aspx

From George Shepherd's ASP.NET FAQ at http://www.syncfusion.com/faq/aspnet/web_c9c.aspx

36.37请问有什么办法知道多少内存被使用会话变量在我的应用程序?

36.37 Is there any way to know how much memory is being used by session variables in my application?

No

不过,你可以让一个受过教育的猜测。在你的字符串的字节数,再加上你的其他会话变量(8一个int等)占用的字节数,次并发用户会话的数量。

However, you can make an educated guess. The number of bytes in your strings, plus the number of bytes taken up by your other session variables (8 for an int, etc.), times the number of concurrent user sessions.

由此可见,你的会话变量必须尽可能小。较小的会话状态,更好的网站将调整。

It follows that your session variables need to be as small as possible. The smaller your session state is, the better the site will scale.

这篇关于如何确定一个会话变量的内存占用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆