GetSessionFactory() is the OP's own method.

Anyway, from the details given it's hard to tell if there is an actual
problem or not. Also the posted code differs from the one in the
screenshot.

"5% of memory". Well... how much is that? Without knowing the absolute
number (in MB) it's impossible to tell if it's unusually large or not.
Also, it of course depends on how many mapped classes and properties
you have. You should profile it in greater detail to see if anything
specific stands out.

As for the 20% CPU... Over what timeframe? For maximum efficiency I
would expect GetSessionFactory() and/or BuildSessionFactory() (or any
other method) to take nearly 100% of CPU until it completes, when
running on an otherwise unloaded system. Two factors can reduce this
efficiency: a) It will connect to the database which will introduce
some delay b) if your disk is slow compared to the size of the
mappings that must be loaded from disk.

As Gustavo said, for most applications this method should run exactly
once during the process lifetime, so as a percentage of the total
runtime of a long-running process, it should be a really low
percentage.

How have you confirmed that the CPU spikes you mention are related to
GetSessionFactory()?

/Oskar


2015-01-17 15:28 GMT+01:00 Gleb Chermennov <thebitteren...@gmail.com>:
> Well, I don't think it's Fluent NHibernate issue - GetSessionFactory is
> NHibernate method.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Fluent NHibernate" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to fluent-nhibernate+unsubscr...@googlegroups.com.
> To post to this group, send email to fluent-nhibernate@googlegroups.com.
> Visit this group at http://groups.google.com/group/fluent-nhibernate.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to fluent-nhibernate+unsubscr...@googlegroups.com.
To post to this group, send email to fluent-nhibernate@googlegroups.com.
Visit this group at http://groups.google.com/group/fluent-nhibernate.
For more options, visit https://groups.google.com/d/optout.

Reply via email to