Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

darkwing

macrumors 65816
Original poster
Jan 6, 2004
1,210
0
Here's a cool thing to do with Leopard:

1) Open TextEdit
2) Open ActivityMonitor and set filter to "TextEdit"
3) Observe ~6 megs of "real memory" usage. This may seem like a lot to some, but all the Cocoa frameworks are loaded and initialized. If you want a powerful GUI you have to pay some overhead. No complaints there.
4) Create 900 empty new text windows.
5) Observe approx ~780 MB of real memory usage. (Again, this is still ok.)
6) Option-click a close box and watch all windows close.
7) Observe ~49 MB of memory usage.

Tiger had horrible memory leaks in Cocoa. So did Panther. So did Jaguar. How long will this framework be in use before basic memory leaks are fixed?

Also, how does thread creation time (my biggest gripe with OSX) get WORSE with Leopard coming out? (According to xbench results.) Simply put, the people over at Apple are idiots. It's cool that they've made a pretty GUI on top of a UNIX foundation, but they clearly have no interest in making it a platform that anyone with a solid computer science background can be proud of.

</rant>
 
Every company has flaws. Every human has flaws. We have to deal with it. If it is a big deal to you, find a way to work for them and fix the problem instead of griping about it.
 
As I understand it one of Apple's design goals with the kernel/OS is to make it appear to be running faster to the end user, rather than improving artificial benchmarks. I've got to say Leopard certainly seems much faster than Tiger especially on my Mac Pro.

Edit: That's regarding the thread creation time, not the memory issue, if that wasn't clear.
 
I have no clue why anyone would open that many text edit windows...

It's a proof of concept. The idea is that, most likely, some failure to de-allocate memory is occurring with each window, but the amount is too small to be easily noticed. When you do it 900 times, you notice the stack up. But the problem was there in the beginning.

Suppose Safari has a similar leak level. Opening 900 blank tabs and closing them would be silly. However, I close / reset Safari maybe once every week or two. Opening and closing 900 tabs between resets is not at all unreasonable for me.
 
first time computer users may not realize that you put more than one character in each file. Apple should have this covered. I for one am going back to my Phillips G7000 for my computing needs.
 
I wonder if part of the issue is that they are now using garbage collection. Are you seeing the leak if you exit the program, or just when you close the windows? If the latter, the collector might simply not have decided to sweep up yet.
 
Here's a cool thing to do if you have time to open up 900 text edit windows for no apparent reason:

1) Click the apple icon
2) Click Shut Down...
3) Observe the computer shutting down
4) Get dressed
5) Put on some cologne
6) Go get laid
 
Here's a cool thing to do if you have time to open up 900 text edit windows for no apparent reason:

1) Click the apple icon
2) Click Shut Down...
3) Observe the computer shutting down
4) Get dressed
5) Put on some cologne
6) Go get laid

Shut down? Now why would you want to go and do that :D
 
It's a proof of concept. The idea is that, most likely, some failure to de-allocate memory is occurring with each window, but the amount is too small to be easily noticed. When you do it 900 times, you notice the stack up. But the problem was there in the beginning.

Suppose Safari has a similar leak level. Opening 900 blank tabs and closing them would be silly. However, I close / reset Safari maybe once every week or two. Opening and closing 900 tabs between resets is not at all unreasonable for me.

Isn't that why you have to reboot every once in awhile. Code will never be completely bug free.
 
Here's a cool thing to do if you have time to open up 900 text edit windows for no apparent reason:

1) Click the apple icon
2) Click Shut Down...
3) Observe the computer shutting down
4) Get dressed
5) Put on some cologne
6) Go get laid

LOL :D

I can see no reason for 900 text windows, or any other window for that matter. It is a shame we can't have 900 Spaces! :eek:
 
Garbage collection is working fine when TextEdit exits. On the surface (using Activity Monitor), it does look like TextEdit itself has a leak. However, it's all deallocated upon exit.

It's quite an extreme leap to condemn an entire engineering group (let along the entire company), because there's something you notice that looks like a problem. It's not rocket science to use Activity Monitor (or other tools) to monitor memory allocation/deallocation. I sincerely doubt you're the first to notice this behavior, especially when it's something so easy check.

edit: There are most likely hundreds of action items for each engineering group. This is most likely one of them, and it's not going to be high on the list. I wouldn't be at all surprised if some groups (if not the majority) are having daily meetings to prioritize them - especially getting the first update for 10.5 out.

If you still think they need to know about the bug, you can signup for a free ADC account and submit a bug report.
 
so, what is so terribly bad about this that it would embarrass you to use?

Apple of all companies should have efficient code...

I truly thought this was a troll post when I clicked on the Forum Spy title...
 
After reading all of this, I am still trying to figure out how this is being called a memory leak. Oh, its not.

This is a rather common "issue", although its not, with ALL OSs. Even OS 9 on back did this.

A memory leak is when a program starts using RAM when not called for and keeps doing so even until there is even no RAM available. Its like overfilling a bath tub.
 
A memory leak is when a program starts using RAM when not called for and keeps doing so even until there is even no RAM available. Its like overfilling a bath tub.

What you're describing is more akin to a buffer overflow. Usually will end up in a crash.

Leaks happen when which is allocated, but never deallocated. That's what garbage collection takes care of.
 
Garbage collection is working fine when TextEdit exits. On the surface (using Activity Monitor), it does look like TextEdit itself has a leak. However, it's all deallocated upon exit.

Of course it is deallocated on exit. Memory deallocation on exit is handled by the operating system. Memory leaks typically refer to unneeded memory that is not deallocated while the program is still running, not when it exits. If the memory stayed allocated even after program exit, that would lead to major problems and the OS would be to blame.
 
LOL :D

I can see no reason for 900 text windows, or any other window for that matter. It is a shame we can't have 900 Spaces! :eek:

Methinks you just inadvertently came up with a use for the 32GB of RAM the Mac Pro supports! :D

On a theoretical note, seeing as how this thread isn't really going too far, is it possible to override the maximum number of Spaces you can have anywhere? Or is it hard coded? I'm perfectly happy with four but meh. I'm not creating a new thread just for the purpose of such a silly musing question :p
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.