Is it that you have a memory leak, or you think NH should just use less memory? try removing the IUserTypes and just map to primitive values. See what happens to the memory consumption then. If it drops, then you can start by investigating the IUserTypes. Kor's correct, without code or context (quantity of data) there isn't much we can do.
--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To post to this group, send email to nhu...@googlegroups.com.
To unsubscribe from this group, send email to nhusers+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
On Thu, Feb 10, 2011 at 11:24 AM, John Davidson <jwdav...@gmail.com> wrote:
> I would change your CreateUser call so that it is not static. This may be
> why the reference is being retained.
> John Davidson
>
> On Thu, Feb 10, 2011 at 11:10 AM, Paul Allington
> <pa...@intelligentpenguin.co.uk> wrote:
>>
>> Ok - have included some code here (please please don't comment on the code
>> itself - I wrote this purely to test this problem, it's not supposed to be
>> production ready code).
>> Idn't 've added a GC.Collect() to the end of the module so that anything in the
--
Les erreurs de grammaire et de syntaxe ont été incluses pour m'assurer
de votre attention
if (session == null) return;
session.Close();
session.Dispose();
GC.Collect();
whether or not session is still held at the GC.Collect depends on
optimizations and debug/release mode. You can get in and view with SOS
where the JIT will hold session until. Either way making it set to
null first would remove a variable.
Map(x => x.Config).CustomType(typeof(UserConfig));
However, when you actually load the User, you would get another
UserConfig instance, this time as part of your model. This instance is
in fact garbage collected.
As Kor said, you are using the same UserConfig class for two
completely different purposes. What I usually have would be a
Domain.UserConfig class, and a corresponding
Persistence.UserConfigUserType class.
On the other hand... it does not seem obvious that this would create
any serious memory issues. Though your DeepCopy() is clearly not doing
a deep copy, but perhaps it looks better in the production code.
/Oskar
2011/2/10 Jason Meckley <jasonm...@gmail.com>:
> Kor may be on to something with your IUserType implementation. IUserTypes
> are not part of the domain, they are part of the infrastructure. a user type
> tells NH when give object X convert it to schema Y.
>
Paul
A more important question is: is it growing over time? That could
indicate a more serious memory leak.
/Oskar
2011/2/10 Paul Allington <pa...@intelligentpenguin.co.uk>:
| Paul Allington T: 01799 522 665 M: 07973 145 754 E: pa...@intelligentpenguin.co.uk W: www.intelligentpenguin.co.uk W: www.creative-penguin.co.uk |
![]() |
| For highly creative & technically brilliant websites, and on-line management systems ------------------------------------------------------------------------------ |
|



phallington
paul-allington
paul_allington--