There is a huge memory leak in Microsofts LocalReport implementation in .Net 4.0
The work around to make it a small memory leak is here,
and in the comments is how to make it go away...
Though I'll warn you it's a pain.
http://stackoverflow.com/questions/6220915/very-high-memory-usage-in-net-4-0
Thursday, November 15, 2012
Wednesday, November 14, 2012
Are you having a memory leak because of Strucutre map?
So here's the situation....
(My parents went away for a weeks vacation...(Soory, can't help myself, child of the 80s...))
Running a winforms app using a Library that has structure map all through it, and it uses ObjectFactory directly instead of IContainer....
So we get memory leaks that we can't get rid of as Structure map is hanging on to instances of the objects so they can't be garbage collected...
Here's the quick hack to fix in,
Since what I'm doing is in a loop, at the bottom of the loop construct I just type:
// strucutre map memory leak hack, works okay i guess, it's slower as expected - EWB
ObjectFactory.ResetDefaults();
and it flushes all the objects out of Structure map...
Of course it's slower because all the objects get re init-ed in each loop, but the memory
got tons better...
Also note that in an upcoming release,
ObjectFactory.ResetDefaults();
will get changed to
ObjectFactory.Reset();
(My parents went away for a weeks vacation...(Soory, can't help myself, child of the 80s...))
Running a winforms app using a Library that has structure map all through it, and it uses ObjectFactory directly instead of IContainer....
So we get memory leaks that we can't get rid of as Structure map is hanging on to instances of the objects so they can't be garbage collected...
Here's the quick hack to fix in,
Since what I'm doing is in a loop, at the bottom of the loop construct I just type:
// strucutre map memory leak hack, works okay i guess, it's slower as expected - EWB
ObjectFactory.ResetDefaults();
and it flushes all the objects out of Structure map...
Of course it's slower because all the objects get re init-ed in each loop, but the memory
got tons better...
Also note that in an upcoming release,
ObjectFactory.ResetDefaults();
will get changed to
ObjectFactory.Reset();
Tuesday, November 13, 2012
The parameter of type 61 did not have a valid value
The parameter of type 61 did not have a valid value
This is an error from the Sybade Database.
It means that a variable of type 61 (Date) does not have a valid value.
This is ususally caused by your Date time not being Nullable in your EO or you CV and because
Microsoft and Sybase have different Epochs, or Minimum Dates values.
Microsofts EPOCH for a DateTime is: 00:00:00.0000000, January 1, 0001
and Sybases depends on the exat type in your DB see the chart here:
http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc35400.1550/html/osref/osref281.htm
But in essence here is what happens.
In the DB the Date is null,
In your EO the dateTime is not nullable
Net converts the null to DateTime.Min (01/01/01)
during an update this value is smaller than the allowed (for us ususally 01/01/1900)
Best fix, it to change the Datetimes in your EO & CV toall be nullable, OR to use a CV that does not contain any of the date fields for updating, and let JCDCHelper deal with it..
See here for the codes of all Sybase datatypes : http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.help.ase_15.0.tables/html/tables/tables69.htm
This is an error from the Sybade Database.
It means that a variable of type 61 (Date) does not have a valid value.
This is ususally caused by your Date time not being Nullable in your EO or you CV and because
Microsoft and Sybase have different Epochs, or Minimum Dates values.
Microsofts EPOCH for a DateTime is: 00:00:00.0000000, January 1, 0001
and Sybases depends on the exat type in your DB see the chart here:
http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc35400.1550/html/osref/osref281.htm
But in essence here is what happens.
In the DB the Date is null,
In your EO the dateTime is not nullable
Net converts the null to DateTime.Min (01/01/01)
during an update this value is smaller than the allowed (for us ususally 01/01/1900)
Best fix, it to change the Datetimes in your EO & CV toall be nullable, OR to use a CV that does not contain any of the date fields for updating, and let JCDCHelper deal with it..
See here for the codes of all Sybase datatypes : http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.help.ase_15.0.tables/html/tables/tables69.htm
Subscribe to:
Posts (Atom)