View Single Post
      03-04-2011, 03:30 AM   #21
radix
you know he kills little girls like you
radix's Avatar
No_Country
388
Rep
892
Posts

Drives: -
Join Date: Feb 2008
Location: -

iTrader: (0)

Quote:
Originally Posted by .:bHd:. View Post
i have no clue how to explain the sound other than regular hard drive working sound just more often lol I have an old HDD laying around here I'm gonna try using that before I buy one

Quote:
Originally Posted by .:bHd:. View Post
I have a feeling it's my HD as well. I'm gonna buy a new one today and mirror my old drive onto the new one. If it works fine then problem solved, if not then.. lets just hope it works.

Even simple tasks such as surfing the web cause hard drive noise. SMART status seemed okay but that hardly detects a failing drive.

If it's a normal hard drive noise then I'm probably right about you being low on memory. Here's how it works:


Physical Memory + Swap = Virtual Memory


Other than kernel memory and binaries, physical memory is primarily used for two things, application memory and file cache. File cache is simple, every time you read from a file, it's contents are cached in memory. Application memory is primarily memory allocated for the processes' "heap", using malloc(3). File cache is "backed" by the file from which the cached data was originally read. heap is backed by swap space.

In the case the a system is low on memory and more memory needs to be allocated (using malloc(3) for instance), a kernel process searches for pages (4k chunks of memory) to page out to disk in order to free up more memory.


Code:
$ pagesize
4096
The process that does this on OS/X is known as the dynamic pager.

Code:
$ ps -ef | grep [p]ager
    0    41     1   0   0:07.22 ??         0:07.22 /sbin/dynamic_pager -F /private/var/vm/swapfile

The paging space (swap) in this case is located under /var/private/vm:


Code:
$ ls -l /private/var/vm/
total 6291456
-rw------T  1 root  wheel  2147483648 Mar  1 08:27 sleepimage
-rw-------  1 root  wheel    67108864 Jan 15 17:07 swapfile0
-rw-------  1 root  wheel    67108864 Mar  4 03:11 swapfile1
-rw-------  1 root  wheel   134217728 Mar  4 03:11 swapfile2
-rw-------  1 root  wheel   268435456 Mar  4 03:11 swapfile3
-rw-------  1 root  wheel   536870912 Mar  4 03:11 swapfile4

and is really nothing more than a series of files that are used as swap devices. So supposing you use all the memory on the system, then try to start a new process which in turn attempts to allocate a lot of memory which is not available, a couple of things can happen depending on the severity of the memory shortage:


1. page outs


The system needs to allocate more pages of physical memory, but first needs to free some to do so. In this case the system should check to see which pages in memory have been least recently used, and then those will be paged out to allow room for the newly allocated pages. If the pages are application memory they will be paged out to swap. If the pages are file cache, then will either simply be freed, or paged out to the file from which they were read.

2. swapping


In this case the system is severely short of memory and entire processes have their application memory paged out to swap. This is known as swapping. In the case that swapping happens consistently, and heavily, this is known as thrashing.


Thrashing happens when your system is continuously reading and writing a large number of pages of physical memory to and from swap. The symptoms of thrashing are:


1. Increased lag starting new processes, or switching processes.
2. Heavy, unexplained hard disk activity.
3. System freezes/hangs.


These sound like the symptoms you have. There are two options:


1. Use less memory. Start fewer processes at once.

or

2. Buy more memory.


In either case, reinstalling the system will only delay the inevitable and will be a waste of time. Fragmentation is also likely not your issue, although you could give it a try.

http://support.apple.com/kb/ht1375
Appreciate 0