From: Rob B. <rb...@qu...> - 2001-08-03 18:28:48
|
At 2:18 PM -0400 8/3/01, Ryan Casey wrote: >> > Posted to c.l.t and tcl-mac mailing list. Wish 8.3.3 on MacOS 9.0 >> >(ppc). I am starting to port my program to Mac. After finding how to >> >make an executable and adding some mac-specific stuff to my OS-specific >> >sections, it seems to work ok (it at least loads :) ). I am having the >> >following problems: My program revolves around up to about 120 (maybe a >> >bit more) photo images being moved around three canvases. Sometimes I >can >> >load up to about 30, but more than that always seems to crash Wish. >> >bgerror does not catch it, and sometimes an 'Error 25' is displayed. >> >> >> Welcome to classic MacOS ( < OS X ) :p > >Thanks :-\ > >> ID 25 means QuickDraw, the graphics layer in the OS, could not get RAM to >> satisfy a need that was graphics related. QD is written in a very >> "optimistic" style which means, there's not much in the way of error >> reporting. > >Ah, glad somebody knows. Thanks for the quick answer! > >> I will go out on a limb and guess that the "partition size" or "memory >> allocation" for your Tcl app (or Tcl shell that in turn runs your code) is >> not high enough for its needs. Which jibes with the problem description. > >> The way you would increase the amount of RAM available to Wish: >> a. select the Wish executable icon >> b. hit Get Info in the FInder (command-I) >> c. click on the popup and change to "memory" >> d. adjust to suit. > >Worked great, except apparently my Mac doesn't have enough memory :-) > >> I would recommend ZoneRanger as an excellent tool for watching the >> shell's real memory usage within its heap in real time. You can download >it >> here: http://www.metrowerks.com/tools/software/zoneranger/ > >This got up to 24MB memory on my app before it crashed and the zone was >destroyed. > >I can't see how it could be using that much memory...each of these images is >~3k in size. The Tk control structures, etc, would take more room, but that >much??? It gets nowhere near this size on PC or Unix. > >Does Mac Classic have virtual (disk cache) memory at all? Should I just >give up and work on the OSX port (especially with OS10.1 coming out soon)? Yes - open up the memory control panel, enable virtual memory, set it as high as you like and reboot. However all this is doing, is setting the size of the single address space which all apps share on OS9 or earlier. OS9 and earlier still have partitions and you would have to change that as well. Technically an OS9 app *can* ask the OS for memory outside of its fixed pool, but I doubt that Tcl's shell makes use of these calls. For example the Metrowerks compiler I agree, if you are manipulating 3KB images, to use that much memory is quite a feat. Are there a lot of intermediate stages involved, maybe some buffers are not being released or something. I should add, there are some cases where QD will crash if it is fed some bad data (like a corrupt PICT format file). ** There's also the possibility that the heap is not out of space at all - it just got corrupted by way of a bug in the Tcl runtime or other code. Then QD comes along and tries to do a memory allocation and fails because of that - it's the victim, not the villain. Anything that could possibly overwrite the end of an array runs the risk of corrupting the heap and bringing this on. Another thing to do is make sure you have MacsBug installed, then you can do a "stdlog" command which will dump a fairly detailed machine state to a log file at the time of failure. This includes a stack crawl and heap dump which can be inspected after the fact. The 'hc' command can be invoked to check heap integrity periodically also. -- Rob Barris Quicksilver Software Inc. rb...@qu... |