Re: Problem with garbage collection in server application [solved]

2011-01-23 Thread Rick Hoge
Hi Quincey, The way you broke this down was very helpful, and it turned out to be a combination of two things you alluded to. I'd been on the right track that it had to do with NIB objects, and thinking about it as you laid out helped identify the problem. On 2011-01-23, at 12:28 AM, Quincey

Re: Problem with garbage collection in server application

2011-01-23 Thread Rick Hoge
On 2011-01-23, at 12:59 AM, Dave Keck wrote: > On the other > hand, if I understood you correctly in that you're seeing a 10% > speedup when using GC, then perhaps that would warrant the extra > effort. On the other-other-hand, it sounds like you might be > optimizing early. Sorry the comment ab

Re: Problem with garbage collection in server application

2011-01-23 Thread Rick Hoge
Sorry - I forgot to mention that I am indeed wrapping my code in its own autorelease pool. This should ensure that the only retain count remaining is from intentional retains by other objects that need to reference my datasets. Rick On 2011-01-23, at 12:59 AM, Dave Keck wrote: > The autorele

Re: Problem with garbage collection in server application

2011-01-23 Thread Rick Hoge
Hi Quincy, Thanks so much for the detailed reply. On 2011-01-23, at 12:28 AM, Quincey Morris wrote: >> [...] > > You *cannot* rely on GC to satisfy your timing requirements for releasing > resources used by your application. You can't even rely rely on GC to release > memory at all, in any d

Re: Problem with garbage collection in server application

2011-01-23 Thread Rick Hoge
On 2011-01-23, at 12:04 AM, Dave Keck wrote: ... >> > I would use gdb's "info gc-roots 0x" command to determine what > strong references exist to the objects that are placed in your array. > Instruments may also have some related functionality. Thanks - I was focusing on Instruments, a

Re: Problem with garbage collection in server application

2011-01-23 Thread Rick Hoge
Thanks Scott, On 2011-01-22, at 11:58 PM, Scott Ribe wrote: > You might try something like usleep(1000) just to see what happens. You might > not need any real delay; you might just need to yield... Tried the above, but the GC version goes back to ballooning memory usage and eventual crash.

Re: Problem with garbage collection in server application

2011-01-22 Thread Rick Hoge
On 2011-01-20, at 10:54 AM, Rick Hoge wrote: [...] > I have overridden the 'finalize' method of the dataset class to print a log > message before calling [super finalize], and when I perform a single > processing 'run' in which the client sends a message to the s

Problem with garbage collection in server application

2011-01-20 Thread Rick Hoge
I have an application based on the "Cocoa Application" template in Xcode (x86_64, currently testing on OSX 10.6.5) that listens for client messages using an NSConnection. Both client and server have been designed for garbage collection, and are compiled GC-only. The client is a simple command

Re: Bound array item is repeatedly copied and collected while scrolling table view

2009-07-07 Thread Rick Hoge
... I noticed that, while I scrolled in the tableview, many copies of these large objects were being created and then immediately collected. ... NSCells used to display table content copies the object it display. Instead of binding the cell value to your object directly, bind it t

Re: Bound array item is repeatedly copied and collected while scrolling table view

2009-07-07 Thread Rick Hoge
... The array items are NSDictionaries, and one of these dictionaries contains a large dataset object that consumes a lot of memory. I noticed that, while I scrolled in the tableview, many copies of these large objects were being created and then immediately collected. It's

Bound array item is repeatedly copied and collected while scrolling table view

2009-07-07 Thread Rick Hoge
I have a nib file in which entries in an NSTableView are bound to an NSMutableArray via an NSArrayController. It is used in an application running under garbage collection. The array items are NSDictionaries, and one of these dictionaries contains a large dataset object that consumes a l

Re: NSArrayController's add: swaps entire content array when array is accessed via keypath

2009-06-26 Thread Rick Hoge
Quincey, Keary, thanks for the replies - ... All worked fine, except that, when the new dictionaries are added by clicking the add: button, the mutable array managed by the controller is replaced with a new array (rather than inserting the new dictionary in the original array). The new

NSArrayController's add: swaps entire content array when array is accessed via keypath

2009-06-25 Thread Rick Hoge
I recently tried a design where a certain object had an NSMutableDictionary instance variable, which in turn contained an NSMutableArray entry. After initializing this setup (in -init) as shown here: topLevelDictionary = [NSMutableDictionary dictionary]; // An instance variable - I'm

Re: Triggering change notifications when modifying custom object ivars in core data app

2009-05-28 Thread Rick Hoge
Just a follow-up. It's not perfect, and I'll revisit the design, but it does what I need for now. Specifically my entity has a 'transformable' attribute for which the values are a custom object class, and this object class has an ivar that is an NSMutableDictionary. The user can modify ent

Re: Triggering change notifications when modifying custom object ivars in core data app

2009-05-28 Thread Rick Hoge
Ben, Quincey, Sean, thanks for the comments. Maybe there are some lower level design issues to rethink. This pattern is usually a flawed model design. If the properties are to be this independently mutable, then there should be a relationship, and/or the complex attribute should be deco

Re: Triggering change notifications when modifying custom object ivars in core data app

2009-05-28 Thread Rick Hoge
change dictionary in observeValueForKeyPath: to break out of the loop when there's no real change. Rick On May 28, 2009, at 12:34 PM, Rick Hoge wrote: On 28-May-09, at 10:39 AM, Keary Suska wrote: On May 28, 2009, at 7:03 AM, Rick Hoge wrote: I have a core data (doc-based) app in

Re: Triggering change notifications when modifying custom object ivars in core data app

2009-05-28 Thread Rick Hoge
On 28-May-09, at 10:39 AM, Keary Suska wrote: On May 28, 2009, at 7:03 AM, Rick Hoge wrote: I have a core data (doc-based) app in which one of the entities includes a custom object as a persistent attribute. The custom object class implements NSCoding, and these objects are saved to

Triggering change notifications when modifying custom object ivars in core data app

2009-05-28 Thread Rick Hoge
I have a core data (doc-based) app in which one of the entities includes a custom object as a persistent attribute. The custom object class implements NSCoding, and these objects are saved to the core data store with no problem (they are read back correctly etc). Instance variables of t

Extending supported document types at run time in doc-based app

2009-03-19 Thread Rick Hoge
I would like to implement a plug-in mechanism which will allow a Cocoa document-based application to load plugins which will implement subclasses of NSDocument for different file types. This would allow custom extension of the application to support 3rd party file types, and could have s

Re: [Solved - duh!] Core data storage of objects whose class is loaded from a bundle

2009-01-30 Thread Rick Hoge
Thanks for the replies - it's clear that it's a problem in my NSCoding support (see comment below) On 29-Jan-09, at 5:18 PM, Nick Zitzmann wrote: On Jan 29, 2009, at 2:32 PM, Rick Hoge wrote: -(id)initWithCoder:(NSCoder*)decoder { self = [super initWithCoder:decoder];

Re: [Solved - duh!] Core data storage of objects whose class is loaded from a bundle

2009-01-29 Thread Rick Hoge
{ self = [[MyPluginSubclass alloc] init]; // I know there will be no subclasses [super initWithCoder:decoder]; return self; } On 29-Jan-09, at 3:28 PM, Rick Hoge wrote: I am working on an app in which plugin subclasses are loaded from bundles at launch time (didFinishLaunching in app

Core data storage of objects whose class is loaded from a bundle

2009-01-29 Thread Rick Hoge
I am working on an app in which plugin subclasses are loaded from bundles at launch time (didFinishLaunching in app delegate). The base plugin class is specified in a framework against which the main app is linked. I can create instances of these dynamically loaded subclasses, and assi

Re: Problem assigning image to button under garbage collection

2009-01-23 Thread Rick Hoge
Bill, Rob - Thanks for the replies, and sorry I missed this in the archives. I have googled about such problems, but did not come up with anything. Is there a known issue with images and buttons under GC? Sounds odd.Please file a bug, attaching the application (binary is good enough

Problem assigning image to button under garbage collection

2009-01-22 Thread Rick Hoge
I have a garbage collected app which has been running fine, with no crashing or leaks and passing nicely using the Xray diagnostic tools. A problem arose when I added an NSButton to my nib file and assigned an image to it in Interface Builder (just entering the image name NSAddTemplate) i

Re: Displaying multiple core data relationships in NSOutlineView

2009-01-17 Thread Rick Hoge
Steve, Quincy: Thank you for the replies! At the moment I'm working with a non-Core-Data class to achieve the outline view, using code adapted from the SourceView example. I am realizing that to be able to archive this and correctly maintain object graphs, I'll likely have to link the ou

Re: Displaying multiple core data relationships in NSOutlineView

2009-01-16 Thread Rick Hoge
Thanks Volker, why don't you have an abstract class that holds the children/parent relationships and make different subclasses for different data types that all inherit from your abstract class. As far as I understand your problem, that should solve it. I have a similar solution working

Displaying multiple core data relationships in NSOutlineView

2009-01-16 Thread Rick Hoge
I'm still trying to get my head around how to achieve a particular outline view display by binding an NSTreeController to Core Data entities. I have some test apps running in which, by binding my tree controller to a "root" entity, I can get a nice outline view showing a hierarchy of ch

Re: Xcode-like "Groups & Files" view: NSTreeController and/or core data?

2009-01-12 Thread Rick Hoge
Hi Douglas, Thanks for the suggestion - I was kind of hoping to hear a vote of confidence for the bindings route. From my experience, I would suggest that you go the route of using NSTreeController along with NSTreeNode. This made life much easier for my heterogeneous dataset. NSTreeNo

Xcode-like "Groups & Files" view: NSTreeController and/or core data?

2009-01-12 Thread Rick Hoge
I have a project in which it would be helpful to create an organizational view for components of a project very similar to the "Groups & Files" view in Xcode. My application would organize pieces of data from a number of experimental sessions, and perform pre- configured sequences of proc

Re: Maintaining mutable values with NSDictionaryControllerKeyValuePair

2009-01-07 Thread Rick Hoge
I pulled my hair out over this one, but I finally found an acceptable workaround, although it doesn't solve the fundamental problem of NSDictionaryController. Thanks very much for the reply and workaround. I will explore this solution further. The NSDictionaryController/bindings route

Re: Maintaining mutable values with NSDictionaryControllerKeyValuePair

2009-01-06 Thread Rick Hoge
I pulled my hair out over this one, but I finally found an acceptable workaround, although it doesn't solve the fundamental problem of NSDictionaryController. Thanks very much for the reply and workaround. I will explore this solution further. The NSDictionaryController/bindings route

Re: Maintaining mutable values with NSDictionaryControllerKeyValuePair

2009-01-06 Thread Rick Hoge
I'm using an NSDictionaryController object to control the data provided to an NSTableView object. I'm attempting to use key-value coding through the dictionary controller to manipulate the data in a bindings-compatible way, by calling the method -arrangedObjects on the NSDictionaryContro

Re: Use of AppKit in command-line app on headless node

2008-08-12 Thread Rick Hoge
Thanks again for that very detailed post - I know it sounds like I'm being lazy, but there are other parts of the app that would have to be redesigned to allow the possibility for code use under headless conditions and it's really important to me to know why this is necessary. What you

Re: Use of AppKit in command-line app on headless node

2008-08-12 Thread Rick Hoge
Thanks for the replies - just got them now as my MobileMe email went offline for some reason last night... I noticed that there is some useful info relating to this topic in the documentation on Agents and Daemons at http://developer.apple.com/technotes/tn2005/tn2083.html#SECLIVINGDANGERO

Re: Use of AppKit in command-line app on headless node

2008-08-11 Thread Rick Hoge
I am trying to factor some frameworks so that code used in a document-based Cocoa app can be shared with command-line tools that might run on a headless node (no window server). I've seen some discussion in the past on questions such as whether NSImage and related classes can be used hea

Use of AppKit in command-line app on headless node

2008-08-11 Thread Rick Hoge
Hi - I am trying to factor some frameworks so that code used in a document- based Cocoa app can be shared with command-line tools that might run on a headless node (no window server). I've seen some discussion in the past on questions such as whether NSImage and related classes can be use

Re: Automatic population of NSTableView with custom columns at launch time

2008-08-05 Thread Rick Hoge
tablecolumns that you want (add new ones). Then call setAutosaveName:. Change the width of a column in your GUI. This should save out the autosave values. Quit your app. Restart it. Are the columns restored? This pattern should work; I use it internally in the open and save panel. corbin On Aug

Re: Automatic population of NSTableView with custom columns at launch time

2008-08-05 Thread Rick Hoge
n and save panel. corbin On Aug 4, 2008, at 3:36 PM, Rick Hoge wrote: Thanks for the suggestion - I tried calling setAutosaveTableColumns: after adding a column from code, but on next launch it only showed the columns that are defined in the nib with IB. Rick On 4-Aug-08, at 5:39 PM, C

Re: Automatic population of NSTableView with custom columns at launch time

2008-08-05 Thread Rick Hoge
yourself. Before you call it, print out all the table columns to see what they are. Then, load your tablecolumns that you want (add new ones). Then call setAutosaveName:. Change the width of a column in your GUI. This should save out the autosave values. Quit your app. Restart it. Are th

Re: Automatic population of NSTableView with custom columns at launch time

2008-08-04 Thread Rick Hoge
ary is loaded and could have hundreds of possible pieces of information, of which a user would typically select some small number). So I'm stuck supporting at least part of the table structure programatically. Rick corbin On Aug 4, 2008, at 5:31 PM, Rick Hoge wrote:

Re: Automatic population of NSTableView with custom columns at launch time

2008-08-04 Thread Rick Hoge
ey are. Then, load your tablecolumns that you want (add new ones). Then call setAutosaveName:. Change the width of a column in your GUI. This should save out the autosave values. Quit your app. Restart it. Are the columns restored? This pattern should work; I use it internally in the open a

Re: Automatic population of NSTableView with custom columns at launch time

2008-08-04 Thread Rick Hoge
ally in the open and save panel. corbin On Aug 4, 2008, at 3:36 PM, Rick Hoge wrote: Thanks for the suggestion - I tried calling setAutosaveTableColumns: after adding a column from code, but on next launch it only showed the columns that are defined in the nib with IB. Rick On 4-Aug-08

Re: Automatic population of NSTableView with custom columns at launch time

2008-08-04 Thread Rick Hoge
) before calling setAutosaveName:, or setAutosaveTableColumns:, then it should work out okay; it will restore all of the widths, positions, etc. corbin On Aug 4, 2008, at 2:03 PM, Rick Hoge wrote: I'm working on an application that will allow users to add columns of descriptive informati

Automatic population of NSTableView with custom columns at launch time

2008-08-04 Thread Rick Hoge
I'm working on an application that will allow users to add columns of descriptive information to an NSTableView - the available columns are determined at launch time by loading a dictionary. In my test app, I can add columns to my table no problem. Now I am trying to decide on a robust a

Re: Xcode style divider with embedded popup and pulldown menus

2008-07-18 Thread Rick Hoge
Thanks for the replies - seems like a custom view and possibly NSMatrix will do the job. Rick On 18-Jul-08, at 12:38 PM, Chris Hanson wrote: On Jul 18, 2008, at 8:39 AM, Rick Hoge wrote: I expect this is a custom class created by Apple - does anyone know of an efficient way to

Xcode style divider with embedded popup and pulldown menus

2008-07-18 Thread Rick Hoge
I would like to include a view divider similar to the one used in Xcode at the top of the editor window (contains forward and back buttons, popups for selection of source file and function, as well as pulldowns for a number of functions). I expect this is a custom class created by Apple -

[Job Posting] Openings for students and/or post-doc in medical imaging lab, Montreal Canada

2008-06-12 Thread Rick Hoge
place to be a student!) The starting time frame is somewhat flexible. For more information about our lab, and some related projects, visit http://unfweb.criugm.qc.ca/rhoge/ http://www.neurolens.org/ or contact me offline at the email address used for this post. Best, Rick

Re: Problem with cblas_sgemm in 64 bit build

2008-06-05 Thread Rick Hoge
As usual I'm sure it will turn out to be some silly small thing (and not a mysterious alignment issue with CBLAS). The strange thing is that the problem only arises when the matrices involved exceed a certain size. After further testing with simplified test cases, I think it actually i

Re: Problem with cblas_sgemm in 64 bit build

2008-06-05 Thread Rick Hoge
Thanks for the suggestions - I had already scoured the 64-bit transition guide, and didn't think I needed to use NSInteger and CGFloat since integers and floats appear to be the same size for both 32 and 64 bit builds. Just to be sure though, I tried replacing any int and float declarati

Problem with cblas_sgemm in 64 bit build

2008-06-04 Thread Rick Hoge
I've been tesing a 64 bit build of an application that uses the BLAS function cblas_sgemm to multiply two matrices. The code works fine in 32 bit builds (building with Xcode 3.0 on Leopard 10.5.3) There is a strange problem that I think I have isolated to the output of the above function