There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Linux and Unix
Tag Cloud
access acer asus batch bios bsod computer crash driver drivers error ethernet excel freeze gaming google gpu graphics hard drive hardware hdmi internet laptop malware memory monitor motherboard mouse network printer problem ram registry router slow software sound svchost.exe trojan usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Operating Systems > Linux and Unix >
Defrag option in Sun Solaris.

Reply  
Thread Tools
Rajini's Avatar
Junior Member with 6 posts.
 
Join Date: Apr 2008
Experience: Intermediate
25-Apr-2008, 04:13 AM #1
Defrag option in Sun Solaris.
Hi All,

I am new to unix and in the process of learning the concepts.

Is there a way to perform Memory defragmentation in Unix?

If there is no option then please explain how memory is handled in a Unix environment and how free space is collected.

Regards,
Rajini
lotuseclat79's Avatar
Distinguished Member with 21,345 posts.
 
Join Date: Sep 2003
Location: -71.45091, 42.27841
25-Apr-2008, 09:50 AM #2
Hi Rajini,

Memory allocation takes place at a couple of levels:
1) when the OS initiates a new process/or thread to execute a program or command, and
2) when a program invokes memory allocation primitives within the name space of the program

Two kinds of memory leaks can occur - at the system level - and the more common memory leaks where program allocated memory is not returned to the memory pool including (leaked threads and open files).

The common solution is a garbage collector which takes care of recycling unreferenced memory.

For C and C++ programs (which do not have garbage collection), one can install the Boehm-Demers- Weiser conservative garbage collector from here.

As for any system/thread level memory leaks, that may be a concern for the kernel. For example, there may be a question about unix domain sockets requiring a mark & sweep garbage collection algorithm - see Unix garbage collection. It is unclear to me from reading that post whether "the problem" exists in Linux and Solaris or Linux and Solaris have such an approach to handling the problem whereas Unix does not.

An interesting concept is discussed in GCFS: a Garbage-Collected Filesystem for Linux.

More on GC here.

-- Tom
__________________
The independence created by philosophical insight is - in my opinion - the mark of distinction
between a mere artisan or specialist and a real seeker after truth. - Einstein 1944
Imagination is more important than knowledge. - Einstein

Last edited by lotuseclat79; 25-Apr-2008 at 10:00 AM..
Rajini's Avatar
Junior Member with 6 posts.
 
Join Date: Apr 2008
Experience: Intermediate
28-Apr-2008, 03:31 AM #3
Hi Tom,

Thanks for the information ,it was useful in understanding few internal concepts on how memory is handled.

Based on your reply ,I have few clarifications....

Two kinds of memory leaks can occur - at the system level - and the more common memory leaks where program allocated memory is not returned to the memory pool including (leaked threads and open files)
<Rajini> Is there a in-built command\process available in "SUN Solaris" which does Garbage collection and takes care of Memory leaks.

The reason I am curious is ,if there is no in-built option available then the only option which I guess for the Server to reclaim the memory would be after a server re-boot.(Correct me I am wrong....)

Regards,
Rajini
lotuseclat79's Avatar
Distinguished Member with 21,345 posts.
 
Join Date: Sep 2003
Location: -71.45091, 42.27841
28-Apr-2008, 12:43 PM #4
Quote:
Originally Posted by Rajini View Post
Hi Tom,

Thanks for the information ,it was useful in understanding few internal concepts on how memory is handled.

Based on your reply ,I have few clarifications....

Two kinds of memory leaks can occur - at the system level - and the more common memory leaks where program allocated memory is not returned to the memory pool including (leaked threads and open files)
<Rajini> Is there a in-built command\process available in "SUN Solaris" which does Garbage collection and takes care of Memory leaks.

The reason I am curious is ,if there is no in-built option available then the only option which I guess for the Server to reclaim the memory would be after a server re-boot.(Correct me I am wrong....)

Regards,
Rajini
Hi Rajini,

Usually, servers are not general purpose, e.g. a dedicated data base server host, or an Apache web server running on a web host (other servers may also be running).

Some hosts (nodes on networks), have more than one special purpose server running.

It all depends on whether the memory leak was caused by poor programming at the user level - in which case, when the command is exited, the system will clean up its use of local memory allocated to it. While the program (command) is running, then if it was compiled with a garbage collecting library - the GC will take care of memory cleanup dynamically while the program (server) is still running.

Then there is the OS which takes care of process level cleanup after command (programs or servers) are exited.

A server reboot does not have to mean a total system OS reboot, just an exit for the server, and then re-launch it.

No one system level garbage collector is needed. Each command or server probably manages its own allocated memory - unless it has an unknown bug that occurs, and the server needs to be rebooted (not the entire system).

-- Tom
__________________
The independence created by philosophical insight is - in my opinion - the mark of distinction
between a mere artisan or specialist and a real seeker after truth. - Einstein 1944
Imagination is more important than knowledge. - Einstein
Reply

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 07:31 AM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.