Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Coalescing memory on Sun
andreyNSPAM_at_bookexchange.net (NetComrade) writes:
> Can memory get fragmented on Unix, therefore no big chunk being able
> allocated?
> If yes, is there are a way to defragment it?
> ---------------
> Andrey Dmitriev eFax: (978) 383-5892 Daytime: (917) 373-5417
> AOL: NetComrade ICQ: 11340726 remove NSPAM to email
>
No, memory can't be "fragmented". (In fact it is almost always fragmented).
The memory is divided into equally sized units called "pages", and memory is allocated as a number of pages, and these need not be consecutive. The mmu is used to map physically scattered pages into a logically consecutive address space.
The address space can become fragmented though such that there is no hole large enough to allow a segment to be mapped into.
The current address space of a process can be seen with:
/usr/proc/bin/pmap -x <pid>
The pagesize is normally either 4k or 8k, as can be seen with the command "pagesize".
You may of course also run out of virtual memory (ram + swap).
The address space can be fragmented if a lot of small segments are mapped and then some of them in the middle are removed. There is really nothing (AFAIK) you can do other than to modify the app to not do this.
Do you have an actual example of a problem?
--
Thomas Tornblom Tel: +46 8 623 9100 E-mail: Thomas.Tornblom_at_Sun.SE Sun Microsystems AB Fax: +46 8 623 9102Received on Fri Aug 13 1999 - 15:03:25 CDT