NHibernate的使用大量的内存 [英] Nhibernate uses a lot of memory

查看:254
本文介绍了NHibernate的使用大量的内存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有功能NHibernate在我的应用程序,我试图找到高内存使用情况的原因。 (我说的高,这是60MB,但它是一个Web应用程序,它不是非常大),不幸的是,它看起来像有很多是在非托管内存,所​​以我开始服用的东西 - 而且只要我拿出NHibernate的任何电话,内存使用量下降到11MB!为什么啊,为什么会被占用这么多内存?特别是,为什么会被占用非托管内存?

I've got fluent nhibernate in my application and I'm trying to locate the cause of high memory usage. (I say high, it's 60MB, but it's a web app and it's not very big) Unfortunately it looks like a lot of it is in unmanaged memory, so I started taking things out - and as soon as I took out any calls to nhibernate, the memory usage dropped to 11MB!! Why oh why would it be taking up so much memory? Especially, why would it be taking up unmanaged memory?

我一直在'谷歌搜索'这一整天我能看到的是从人们说帖的NHibernate吃记忆......,并回答了说不不,没有证据。是NHibernate的人否认呢?

I've been 'Googling' this all day and all I can find are posts from people saying "NHibernate eats memory..." and answers that say "no it doesn't, there's no evidence". Are NHibernate people in denial about it?

推荐答案

可能的原因:NHibernate的缓存

Possible reasons: NHibernate caching.

检查这些文章:


  • <一个href=\"http://nhforge.org/blogs/nhibernate/archive/2009/04/24/nhibernate-2nd-level-cache.aspx\">http://nhforge.org/blogs/nhibernate/archive/2009/04/24/nhibernate-2nd-level-cache.aspx

<一个href=\"http://nhforge.org/blogs/nhibernate/archive/2009/02/09/quickly-setting-up-and-using-nhibernate-s-second-level-cache.aspx\">http://nhforge.org/blogs/nhibernate/archive/2009/02/09/quickly-setting-up-and-using-nhibernate-s-second-level-cache.aspx

请记住更多的内存使用量不应该是这就是魔鬼。我的意思是,有些缓存或其他因素会提高整体性能,如果机器托管事事有足够的资源。

Keep in mind "more memory usage" shouldn't be "this is devil". I mean that some caching or other factors would increase overall performance if the machine hosting everything has enough resources.

您可以使用这个免费的探查,所以你可以检查什么是浪费你的记忆 - 这也许不是浪费内存,但对于性能优化正确使用 - :

You can use this free profiler too, so you can check what's "wasting" your memory - maybe it's not a waste of memory but a proper usage for performance optimization - :

  • http://www.eqatec.com/tools/profiler/

这篇关于NHibernate的使用大量的内存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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