Hi Chuck,

I think this problem only happens if the undoManager is set to null (see [1] 
and [2]). I've been using the disableUndoRegistration method in production for 
quite some time without problems.

[1]http://markmail.org/message/m2mw4hf4266k2don
[2]http://en.wikibooks.org/wiki/WebObjects/EOF/Using_EOF/Memory_Management#NSUndoManager

Cheers,

Henrique

On 26/04/2013, at 14:34, Chuck Hill <[email protected]> wrote:

> That can cause problems if the saveChanges fails, EOF uses the undo stack to 
> revert partially saved changes.  I think... that is for things like cascade 
> delete rules.
> 
> Chuck
> 
> 
> On 2013-04-26, at 10:30 AM, Henrique Prange wrote:
> 
>> Hi Joseph,
>> 
>> You can also completely disable the undo registration to save some memory:
>> 
>> editingContext.undoManager().disableUndoRegistration();
>> 
>> Of course, editingContext.undo() and editingContext.redo() will not work in 
>> this scenario.
>> 
>> Cheers,
>> 
>> Henrique
>> 
>> On 26/04/2013, at 14:12, Chuck Hill <[email protected]> wrote:
>> 
>>> Are you using the session's default editing context exclusively?  For 
>>> memory usage optimization it is best to treat that as a read only editing 
>>> context and just use it for session spanning objects (like the current 
>>> user, their roles and permissions).  Then on each page, or in each stream 
>>> of activity, create, lock, use, unlock, and dispose of a new editing 
>>> context.  I covered this in at least one of my WOWODC presentations.
>>> 
>>> You can also make an EC subclass and clear the undo stack after a 
>>> successful save:
>>>   public void saveChanges()
>>>   {
>>>       super.saveChanges();
>>>       if (undoManager() != null)
>>>       {
>>>           undoManager().removeAllActions();
>>>       }
>>>   }
>>> 
>>> Though that is less useful if you are only keeping the EC alive for one 
>>> save cycle.
>>> 
>>> Chuck
>>> 
>>> 
>>> On 2013-04-26, at 4:55 AM, Joseph Pachod wrote:
>>> 
>>>> Hi
>>>> 
>>>> When looking at some memory dumps, I see huge numbers of EOF related 
>>>> instances, such as, by decreasing order and with % of instance nb and % of 
>>>> heap size :
>>>> - _EOHandlerWeakRef 5,8% - 5,1%,
>>>> - EOAccessArrayFaultHandler 5,7% - 6,6%
>>>> - _EOCheapCopyMutableArray 2,9% - 1%
>>>> - _EOMutableKnownKeyDictionnary 2,1% - 3;3%
>>>> - _EOWeakReference 1,2% - 1%
>>>> 
>>>> The overall JVM is about 360Mo. Each session of the application looks like 
>>>> holding quite some of them (they're nicely garbage collected on session 
>>>> termination). So they look like editing context related.
>>>> 
>>>> I was wondering it there were some tricks to clean up these objects. 
>>>> 
>>>> For example can the WeakReference be clean up somehow ? Can the editing 
>>>> context cache be cleaned up to retain only the dirty objects ? Or maybe to 
>>>> remove some of the least used entities (or not used for quite some time) ? 
>>>> 
>>>> Any hint welcomed :)
>>>> 
>>>> Thanks in advance
>>>> best
>>>> 
>>>> _______________________________________________
>>>> Do not post admin requests to the list. They will be ignored.
>>>> Webobjects-dev mailing list      ([email protected])
>>>> Help/Unsubscribe/Update your Subscription:
>>>> https://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net
>>>> 
>>>> This email sent to [email protected]
>>> 
>>> -- 
>>> Chuck Hill             
>>> Executive Managing Partner, VP Development and Technical Services
>>> 
>>> Practical WebObjects - for developers who want to increase their overall 
>>> knowledge of WebObjects or who are trying to solve specific problems.    
>>> http://www.global-village.net/gvc/practical_webobjects
>>> 
>>> Global Village Consulting ranks 13th in 2012 in BIV's Top 100 Fastest 
>>> Growing Companies in B.C! 
>>> Global Village Consulting ranks 76th in 24th annual PROFIT 200 ranking of 
>>> Canada’s Fastest-Growing Companies by PROFIT Magazine!
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> _______________________________________________
>>> Do not post admin requests to the list. They will be ignored.
>>> Webobjects-dev mailing list      ([email protected])
>>> Help/Unsubscribe/Update your Subscription:
>>> https://lists.apple.com/mailman/options/webobjects-dev/hprange%40gmail.com
>>> 
>>> This email sent to [email protected]
>> 
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list      ([email protected])
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net
>> 
>> This email sent to [email protected]
> 
> -- 
> Chuck Hill             
> Executive Managing Partner, VP Development and Technical Services
> 
> Practical WebObjects - for developers who want to increase their overall 
> knowledge of WebObjects or who are trying to solve specific problems.    
> http://www.global-village.net/gvc/practical_webobjects
> 
> Global Village Consulting ranks 13th in 2012 in BIV's Top 100 Fastest Growing 
> Companies in B.C! 
> Global Village Consulting ranks 76th in 24th annual PROFIT 200 ranking of 
> Canada’s Fastest-Growing Companies by PROFIT Magazine!
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to