More question about Macs... (updated)

IcemanJer

Diamond Member
Mar 9, 2001
4,307
0
0
For the Mac experts... even though OS 7.1 and above have the Force Quit option, most of the time it doesn't work when an application hangs or crashes, and I end up having to reset the computer. In another thread (in this forum), the distinction between memory management of Win9x and Win2K has been pointed out, so now my question is how exactly does the MacOS (I guess I'll specify OS 8.6 and OS 9 here) manage memory resources?
 

pulpp

Platinum Member
May 14, 2001
2,137
0
0
i am not an expert on Macs, but from what i understand the MacOS doesnt support protected memory for each applacation as windows does, thats why when one app craches it brings down the whole system.
 

IcemanJer

Diamond Member
Mar 9, 2001
4,307
0
0
How does protected memory work?
I read somewhere that says the MacOS allocate chunks of memory in the order that each application is opened. And in order for the system to re-claim all the allocated memory when one application closes, the applications have to be closed in the reverse order that they're opened (like a stack, last in first out).. is there any merit to this conclusion?
 

charrison

Lifer
Oct 13, 1999
17,033
1
81
Protected memory works at the hardware level. Each process gets its own virtual address space. So if a bad address is generated, its own address space get smashed and not some other processes address space.
 

pulpp

Platinum Member
May 14, 2001
2,137
0
0
the way protected memory works is roughly this, each process started gets its own exclusive virtual memory range allocated to it by the OS, this serves two purposes, first it protects each process privacy, so no processes can snoop on each other, second it prevents one process from writing in the memory of other processes and causing them to get corrupted, when a process tries to access memory outside its allocated range on a protected memeory OS you get whats called segmentation error and the offending process gets terminated by the OS.
 

CTho9305

Elite Member
Jul 26, 2000
9,214
1
81
I believe MacOS also uses a different type of multitasking... preemptive instead of cooperative (or somethign like that). the basic idea is that any one program is free to use up all the resources and take up all the cpu time, whereas windows/unix is supposed to make sure they all share. I don't remember any more detail than that
 

gaidin123

Senior member
May 5, 2000
962
0
0
Like charrison and pulpp said, protected memory gives each application it's own, private chunk of virtual memory.

In the Classic Mac OS (9.x on down) each program does not get its own chunk of private memory space. When a program tries to access an out-of-bounds memory address in a non-protected memory system, it will likely address memory space that has been allocated to another program, or the System itself. I'm not 100% positive that this is *exactly* what happens when a program crashes on a Mac, but I believe that this is the "gist" of what happens.

One program crashes and manages to corrupt the memory space of the OS or another application which will likely bring the whole system down.

The Classic Mac OSes also use cooperative multitasking which is similar to the way Token ring ethernet worked. The process running in the foreground can take up as much CPU time as it wants leaving all the background processes to pick up whatever CPU time is left whereas in a pre-emptive multitasking environment each process should be getting exactly as much CPU time as it needs and nothing more.

Gaidin
 

Jasonh100

Senior member
Apr 21, 2001
200
0
0
Preemptive multitasking is where the OS has control all the time. Programs that need to do something, have to ask for processor time and the control is always passed back to the os after a certain amount of time.

Cooperative multitasking is where the OS passes complete control over to the application and the application passes it back when it is through.

Windows 9x is commonly called cooperative although I think it is a hybrid between the two.

Windows NT and 2k are definately Preemptive.

I don't know what mac is but I'm pretty sure that anything under OSX would lean toward cooperative and X would definately be preemptive.
 

IcemanJer

Diamond Member
Mar 9, 2001
4,307
0
0
Hmm.. okay, thanks guys, I think it's beginning to make some more sense..

Then how about the second question that I had.. "the MacOS allocate chunks of memory in the order that each application is opened. And in order for the system to re-claim all the allocated memory when one application closes, the applications have to be closed in the reverse order that they're opened (like a stack, last in first out)."

True, false?
 

kgraeme

Diamond Member
Sep 5, 2000
3,536
0
0
Sort of true. Since the Mac allocates a fixed block of memory for every app, quitting apps out of order can leave blocks of free memory that are a fixed size trapped between other app's memory spaces. It's likened to a fragmented hard drive.

If an app launches that needs a memory allocation small enough to fit into one of these holes, it is possible for it to squeeze in. It doesn't always happen though because the system looks for the largest block of free memory which for most people is at the end of the stack, not the middle.

Quitting all the apps, even out of order, typically will let the system see whole stack as available again. However, the system heap usually grows with every app launched, so the system may still reserve some memory and not give it all back.

All of this, of course, refers to the Mac prior to OS X. OS X is so different from the previous system architecture that calling it a Mac is pure marketing. Similar to how Win3.1 and Win2K share the Windows name.
 

BFG10K

Lifer
Aug 14, 2000
22,709
2,979
126
Mac OS is like Windows 3.11. Basically everything in it is left over from the 1980s and the entire OS is a dinosaur. Mac OS has:

-static memory allocation.
-no real VM or caching.
-CMT.
-no real concept of device drivers.
-no protected memory.

The first point is why the memory gets fragmented and leaked so often.
The third point is why a single app can control the processor and lock out all other processes.
The last point is why applications can easily crash the entire system.
 

IcemanJer

Diamond Member
Mar 9, 2001
4,307
0
0
Wow, okay, it's so much clearer now! Thanks to all who replied.

Okay, changing the topic a bit here.. how does the PRAM in Macs work, and why is the user always asked to reset the PRAM when the "flashing question" mark always come up?

From what I understand, PRAM stands for Parameter RAM, and it stores info like the hardware state of communcation devices and such. Resetting the PRAM will restore it back to the factory default setting, so in other words can we loosely equate that with flashing the BIOS?
 

ErikaeanLogic

Platinum Member
Feb 14, 2000
2,469
0
76
Zapping the PRAM is the first step in troubleshooting; it resets all hardware configurations to default in order to ease the load of the set of system extensions during the boot process. Why is this so useful? If you load a new application or hardware driver into the OS, a set of preferences and possibly extensions are added to the System folder; if there is a resource conflict, similar to a PC's interrupt request conflict, while loading the system's OS, the boot process can/will freeze. Resetting parameters which have changed since the OS was loaded can help to resolve this conflict. In fact, I like to attempt to load the OS with extensions disabled(Mac Safe Mode?) to see if there is an extension conflict(if the OS loads with extensions disabled, you have your culprit), view the Extensions folder to attempt to locate the offending extension, terminate it, and attempt a reboot. If the OS now loads successfully with extensions re-enabled, you've resolved the issue. If not, zapping the PRAM is a nice basic resolution; I like to see if I can find the conflicting extension first, though, contrary to what Apple recommends.
 

gaidin123

Senior member
May 5, 2000
962
0
0
Resetting the PRAM in Macs is more similar to resetting the CMOS or loading up the BIOS defaults than flashing the BIOS. Resetting the PRAM in a Mac will set things like the key repeat rate, mouse tracking speed, volume of the speakers, appletalk port (ie serial or ethernet or whatever), startup device, time/date, etc. back to factory default settings. This definitely helps out a lot in basic troubleshooting of a mac. Oftentimes if the networking suddenly gets weird or if the machine "loses" its startup device, zapping the PRAM is the quickest, easiest thing to troubleshoot first.

Gaidin

 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |