Bad Programming - Alfa Romeo Forum
You are currently unregistered, register for more features.    
Rant Room Clean ranting only - No Swearing!

 3Likes
  • 1 Post By Verbout
  • 1 Post By VO2Max
  • 1 Post By GhostyDog
 
Thread Tools
(Post Link) post #1 of 15 Old 01-08-15 Thread Starter
Status: Wishing people were nicer
AO Gold Member
 
FredDibnah's Avatar
 
Join Date: Mar 2008
Location: The Beautiful UK
County: Surrey
Posts: 6,881
Bad Programming

I'm in a bad mood today (see earlier Outsourcing thread in Rant Room if you are in the least bit interested why) and having to spend a lot of time on the Internet too as a result (getting numbers, searching for info etc). This is not a good combination.

So now on my iMac I run Mountain Lion rather than Yosemite because my iMac is a 2008 model and only has 2GB and I'm too mean to buy a new one. As a result I always run Dr Cleaner in the background to monitor memory usage and tidy up fragmentation when starting and stopping heavy memory usage apps like iTunes and iPhoto.

What I have noticed, however, is just how poorly written the memory management is of Safari.

After a clean boot my iMac shows utilization of around 80% of memory (so about 1.6 of the 2GB used) due to apps initialising, downloads etc etc. I run Dr Cleaner after each reboot and that brings utilization down to a steady state of around 55% usage.

If all I do then is launch Safari it goes up to around 70% memory utilization, but as I browse and switch windows/sites etc over the course of around 1 hour it shows utilization of 90-98% and everything slows riiiiight dooooowwwnnnnn. I then run Dr Cleaner again and get it back to 70-75% and go again.

And here's the rub - if I just exit Safari, it doesn't free much of it up (maybe a couple of percent).

Now - Why do I have to be manually in charge of memory cleanup? Why is Safari such a leaky app? Why does Apple's flagship browser do such a lousy job of memory management? Why is it ok for Apple to release stuff like this?

When I learned to code in the early 1980s you treated memory like the precious jewel that it was. If you allocated yourself a big old chunk of 8k RAM for your process, you had better return all 8k when you exited otherwise your boss, or your testing team, would send you back a snitty note about learning how to manage your heaps/stacks and queues before releasing code. It was a sin.

Nowadays we trash around with Gigabytes of memory and happily leave hundreds of Megabytes locked up and unusable at exit.

For what I do with my iMac, the 2GB should be quite enough. I shouldn't need to be hovering at 98% capacity most of the time.

Presumably in Cupertino they are too busy trying on Polo Neck jumpers and counting their self-congratulatory awards and share price to actually be doing a good tech job on writing code.
FredDibnah is offline  
Sponsored Links
Advertisement
 
Status: Six parts gin to one part Vermouth
AO Silver Member
 
Clovis's Avatar
 
Join Date: Apr 2011
Location: United Kingdom
County: Bristol
Posts: 1,255

Member car:

GT JTS

I stopped at Fortran77 and BBC Basic, Fred but a good rant.
Clovis is offline  
VO2Max
Status: - Update
Guest
 
Posts: n/a
Quote:
Originally Posted by FredDibnah View Post
Presumably in Cupertino they are too busy trying on Polo Neck jumpers and counting their self-congratulatory awards and share price to actually be doing a good tech job on writing code.

Or maybe they're congratulating themselves on the latest new-computer sales figures?
 
Status: T-5 Days to Unicorn Paradise
AO Platinum Member
 
TheGrimJeeper's Avatar
 
Join Date: Sep 2009
Location: France
County: Riviera
Posts: 38,319
Bloat.


Software starts out great but over the years people who had nothing to do with the original application come in and bolt features on. Normally at the request of marketing and or one large client.


New Windows10 browser is meant to be good.
Give it a few years and it won't be.
TheGrimJeeper is offline  
Status: Meh....
AO Platinum Member
 
Verbout's Avatar
 
Join Date: Feb 2014
Location: United Kingdom
County: West Yorkshire
Posts: 12,347
Garage

Member car:

Lexus

A bit like people.
BigFoot likes this.
Verbout is offline  
Status: -
AO Platinum Member
 
MalcQV's Avatar
 
Join Date: Sep 2011
Location: United Kingdom
County: Greater Manchester
Posts: 13,526

Member car:

Office Chair.

I thought that was only *Windaz code that did that?

* As a UNIX admin I actually rather like Windaz now. Shush though don't tell I'll be thrown out of the UNIX club.
MalcQV is online now  
Status: Broken again...
AO Platinum Member
 
GhostyDog's Avatar
 
Join Date: Sep 2005
Location: Right Side O The Pennines
County: West Yorkshire
Posts: 25,672
All browsers are like this, Chrome is particularly bad, the more tabs you have open the more hungry it gets as each tab is a process in it's own right, also a lot of sites with dynamic content now rely on client side code to build and render the site, this takes cpu and memory, I bet a plain old page of html doesn't cause massive bloat, but a page full of dynamic advertising and video streams is going to use an awful lot of dynamic cache.

Why not just upgrade the physical memory in your machine? the reason it slows down is because it's swapping out unused memory pages to disk, you've essentially got a resource bottleneck you can't do anything about other than add more resource, in your case the best approach would be more dynamic ram, as it's relatively cheap and easy to install. A step further would be to replace the spinning disk for SSD as this will speed up paging operations between dynamic and static memory as the only limitation will be your bus speed and contention.



So don't blame Safari, blame web developers for being code sloppy (and your innate mingebaggery for not stumping up for a new computer ).

Nero Fuoco 147 Lusso - Bianco Nuvola 147 GTA - Carbonio Brera SV - Azzurro Le Mans GT 1600 Junior
GhostyDog is offline  
Status: The BSD says konnichiwa
Global Mod Team
 
BigFoot's Avatar
 
Join Date: Jul 2003
Location: Japan
County: Tokyo
Posts: 114,689
Just on AO you can read this sort of post and replies. Kudos to you all
BigFoot is offline  
VO2Max
Status: - Update
Guest
 
Posts: n/a
The IT Crowd...don'tcha just love 'em?
BigFoot likes this.
 
Status: Broken again...
AO Platinum Member
 
GhostyDog's Avatar
 
Join Date: Sep 2005
Location: Right Side O The Pennines
County: West Yorkshire
Posts: 25,672
Bog right off
VO2Max likes this.
GhostyDog is offline  
Status: Meh....
AO Platinum Member
 
Verbout's Avatar
 
Join Date: Feb 2014
Location: United Kingdom
County: West Yorkshire
Posts: 12,347
Garage

Member car:

Lexus

Do you mean Log right off........No?
Verbout is offline  
Status: T-5 Days to Unicorn Paradise
AO Platinum Member
 
TheGrimJeeper's Avatar
 
Join Date: Sep 2009
Location: France
County: Riviera
Posts: 38,319
Quote:
Originally Posted by VO2Max View Post
The IT Crowd...don'tcha just love 'em?
Shut it, Bicycle-Man.

TheGrimJeeper is offline  
VO2Max
Status: - Update
Guest
 
Posts: n/a
 
rxe
Status: Busso
AO Silver Member
 
Join Date: Apr 2012
Location: United Kingdom
County: Berkshire
Posts: 4,137
Is it actually swapping, or is the OS just caching files and appearing to consume memory? Former bad, latter is good, though superficially looks scary.
rxe is offline  
Status: I'm not really here
Club Member
Membro Premio
 
Club Member Number: 59
Join Date: Aug 2006
Posts: 76,931
Garage
"When I learned to code in the early 1980s you treated memory like the precious jewel that it was. If you allocated yourself a big old chunk of 8k RAM for your process, you had better return all 8k when you exited otherwise your boss, or your testing team, would send you back a snitty note about learning how to manage your heaps/stacks and queues before releasing code. It was a sin."

this

:tum:
steveisfrowning is offline  
Reply

Go Back   Alfa Romeo Forum > Misc Lounges > Community Discussions > Rant Room

Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page



Posting Rules  
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

 
For the best viewing experience please update your browser to Google Chrome