内存压力会导致 ASP.NET 中的会话数据驱逐吗?

发布于 2024-08-06 05:04:46 字数 111 浏览 4 评论 0原文

内存压力是否会导致 ASP.NET 中的会话信息被逐出?

如果是这样,这只会在所有缓存被逐出之后才会发生(即使使用 CachePriority.Highest),还是发生这种情况的阈值是多少?

Does Memory Pressure ever cause Session Information to be evicted in ASP.NET?

If so, will this only happen after all Caches are evicted (even with CachePriority.Highest), or what is the threshold for this to happen?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

那一片橙海, 2024-08-13 05:04:46

它不会像缓存一样被自动清除以节省内存。但是,如果工作进程内存不足,它将自动重新启动。如果您使用 InProc 会话存储,这意味着所有会话都将丢失。

It will not be auto-purged in order to save memory in the same way that Cache is. However, if the worker process runs out of memory, it will be auto-restarted. If you are using InProc session storage, this means that all sessions will be lost.

七堇年 2024-08-13 05:04:46

Session 对象是一个单独的单元。如果由于缺乏内存资源而缩短会话,则会删除整个对象,而不是单个属性。

如果您遇到 Session 对象中的单个值消失的情况,最可能的原因是您在某处有一些代码将其删除。

The Session object is a single unit. If the session is cut short because of a lack of memory resources, the entire object is removed, not single properties.

If you experience that single values in a Session object disappears, the most likely reason is that you have some code somewhere that removes it.

诗酒趁年少 2024-08-13 05:04:46

Session和Cache绝对是易失性存储介质。我不确定是否存在相互影响的优先级,但是您需要考虑的因素不仅仅是内存压力。例如,只需修改 web.config(回收应用程序池)即可擦除 Session。当然,这是假设您正在使用默认的会话存储提供程序——您可以更改为进程外存储或 SQL 会话存储(如果这可能对您的特定场景有帮助的话)。

Session and Cache are definitely volatile storage mediums. I'm unsure if there is a priority that effects one another, but there are more factors than just memory pressure that you need to account for. For example, Session will be wiped simply by modifying the web.config (which recycles the app pool). This is of course assuming that you are using the default Session storage provider -- you can change to out of process, or SQL Session storage if that may help in your specific scenario.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文