Welcome to 2010. The Chrome window where I'm writing this uses about 200MB.
You can use a memory profiler like dotTrace or ANTS to find out who uses the
memory.
Diego
On Mon, Nov 22, 2010 at 11:42, Renan <[email protected]> wrote:
> Hello!
>
> I'm newbie using NHibernate, and my app is using lots of memory.
> I have only about 20 class mapped, and the DB don't have more than a
> thousand in those tables.
> And my app pool is using more than 90 mb...
>
>
> I'm using this class to load the nhibernate:
>
> ---------------
> public sealed class NHibernateHelper : INhibernateHelper
> {
> private const string CurrentSessionKey =
> "nhibernate.current_session";
> private static readonly ISessionFactory sessionFactory;
>
> static NHibernateHelper() {
> Configuration cfg = new Configuration();
> cfg.Configure();
> //mappings
> cfg.AddAssembly("persistencia");
>
> sessionFactory = cfg.BuildSessionFactory();
> }
>
> public static ISession GetCurrentSession() {
> HttpContext context = HttpContext.Current;
> ISession currentSession = context.Items[CurrentSessionKey] as
> ISession;
>
> if ( currentSession == null ) {
> currentSession = sessionFactory.OpenSession();
> context.Items[CurrentSessionKey] = currentSession;
> }
>
> return currentSession;
> }
>
> public static void CloseSession() {
> HttpContext context = HttpContext.Current;
> ISession currentSession = context.Items[CurrentSessionKey] as
> ISession;
>
> if ( currentSession == null ) {
> // No current session
> return;
> }
> currentSession.Flush();
> currentSession.Close();
> context.Items.Remove(CurrentSessionKey);
> }
> ---------------
>
>
> Can someone help me? What am i doing wrong, that is making this memory
> consumption...
>
> --
> You received this message because you are subscribed to the Google Groups
> "nhusers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<nhusers%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/nhusers?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.