Adjusting to a New Culture

A composed satellite photograph of North Ameri...

Image via Wikipedia

Adjusting to a New Culture

Initially brought to you by Cathy Lemmon and Xiaodong Qi.

Included in Queen’s University Chinese Scholars Handbook version 2.3.

Last updated: Jan, 2011.

After you arrive in North America from China you may find that you are having difficulty adjusting to living in a new culture.  You may experience feelings of surprise, disorientation, uncertainty, confusion, etc. when you discover that you are operating under a new and often unknown set of cultural “rules”.  This realization may cause you to dislike certain aspects of the new culture and cause you some anxiety.  This is normal and happens, on some level, to most people who immerse themselves in a new culture.  We have written about it here in case it happens to you and to offer suggestions to help you cope with it.

Recognizing the stages of cultural adjustment.

1. Initially, you may be fascinated and excited by all of the new things that you are seeing and experiencing.  Everything is new and different and you may feel very excited about being in a new culture.

2. After your initial fascination at being in a new country and culture, you may find yourself immersed in problems with housing, transportation, food, language, and new friends. This may cause you to feel fatigue from continuously trying to comprehend and use a second language. You may wonder, “Why did I come here?”

3. At some point you may begin to feel lonely, even though you have made friends, you have been                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       away from your family and good friends for a long period of time and may be missing them. You may still feel that you cannot express yourself as well as you can in your native language. This may make you feel frustrated and you may feel a loss of self-confidence.

4. Soon, everyday activities such as housing and going to school become easier. You may not yet be perfectly fluent in the language spoken but basic ideas and feelings in the second language can be expressed.  You may be making more friends and finding yourself part of a community.

5. Time and perseverance will help you settle into a routine.  Research shows that staying focused on figuring out cultural differences or problems (as opposed to ignoring or avoiding them) will be helpful in successful cultural adjustment.  If you learn about and accept the habits, customs, food, and characteristics of your new friends and feel more comfortable using the language of the country, chances are that your school, work and social life will soon be established. You also may find yourself at ease in the new culture.

Cultural Skills for the Western Context

This section of the Handbook is designed to help you adjust to the Western culture.  We will start by talking about “culture” and why it is sometime difficult to move from one to another.

Many people would define the word “culture” as art, literature, music, food and they would not be wrong.  But culture can also be defined as the rules that a society lives by — not the “laws” of a country — but the social “rules”.  Let me explain…

Culture is made up of the values, beliefs and attitudes that you learn from the group you live with. You are not born with “culture” – you learn it.  The culture that you were born into, or learned as you were growing up, was created according to the needs of the group – your group.  Your family has a culture.  You know who the head of the family is. You know the rules that apply to the culture of your family.                               You know that every time you sit down to eat a meal with your family you know where                               to sit.  You know, generally, how to behave in all circumstances in your home and                                          with your family.  It’s not something that you have to think about – you just know it.

If you work at a job there is also a culture of your workplace.  This culture may be very different than your family culture.  You know who the boss is and you know if he/she looks at you in a certain way you are in trouble. You can tell by your co-worker’s body movements that he/she is in a good mood or having a difficult day. You know what is expected of you in any situation.  You know, generally, how to behave in all circumstances in your workplace.  It’s not something that you have to think about – you just know it.

The “culture” of your family and your workplace may be very different but you move between them every day and you do it effortlessly.  Your group of friends has its own “culture” and you know the “rules” or appropriate behaviours that are expected when you are in that group as well.  Knowing the “rules” or “appropriate behaviours” of each group or “culture” lets you move from one to another with little or no effort.  But what happens when you move into a group or “culture” where you do not know the rules?    You might find yourself being confused and frustrated, and trying to figure out the strange behaviour of these new people.  They do not act the same way as people from home.  Why is that?

One of the leading cultural theorists, Geert Hofstede, offers the general terms “Individualism” and “Collectivism” as being important cultural categories.

People from “individualist” cultures tend to see communication as practical – to send and receive information and solve problems.  They generally are open, direct and explicit (“up front” and “to the point”).  If a topic is discussed it is assumed that it is understood.  If it is not understood, clarification or further explanation will be requested by the individual requiring it.  People from an individualist culture may offer help, give advice and criticism, and ask questions without being asked to.  People from individualist cultures are not overly concerned about the impact their decisions or actions might have on their family or community.

In “collectivist” cultures people see communication as a way of building relationships.  Normally communication in this type of culture will be indirect and implicit — too much directness may be seen as rude. People in collectivist cultures do not generally interfere, give advice, offer help or ask questions unless asked to.  If an issue is not fully understood a collectivist may not ask for clarification. People from collectivist cultures often do consider the impact their decisions and actions will have on their family and community.

Here is a chart that shows where certain “cultures” fall along the scale of “Individualism” and “Collectivism”.  Look to see where your “home” culture falls on the scale and where the “Western” culture falls.  Seeing how far apart they are makes it easier to understand why cultural differences may occur.

Kyra Garson,
2010 International Educators Training Program (IETP)

To help ease the transition into the Western cultures we offer you a few tips that we hope you will find helpful.

Culturally Appropriate Behaviour

In most western cultures, expressing one’s opinion firmly in a group setting is taken as a sign of individual initiative and is often rewarded. This is seen as contributing to the team – and everyone is expected to contribute. Even if a member of the group offers an opinion that others disagree with – this is not         seen, by the group, as a bad thing but as a chance to debate the merits of a different opinion.                Those not offering any opinion may be seen by others as disinterested or having nothing to                contribute.  This may result in being undervalued or receiving a poor grade for group or class participation.

In some cultures, expressing one’s opinion firmly in a group setting is regarded as disrespectful or aggressive.  There may also be a fear of making mistakes or feeling embarrassed. So you can see how learning appropriate ways of participating in group work, in the Western context, is a necessary skill to possess for your time at your university, in North America and when or if you enter the workforce.

Learning culturally appropriate behaviour for participating in a group setting is a skill that will help you in social settings as well. Situations like…how to make social conversation and how to refuse a request, require a subtle change in behaviour for the Western context.   But learning new behaviours can be difficult.  How do you know if you are getting it right? Can books teach you this?

******************

Language/Slang greeting expressions

Westerns may greet you in the following ways:

“Hi there”  What do they mean by using “there”. They actually don’t mean anything more than “Hi”.  This is just an informal greeting.  Your response could be to say “Hi there” back to them. Normally people use this form of greeting when passing friends or acquaintances on the street or in the hall.  They usually do not stop to chat but keep walking along.

“Hi, how are you?” But no one stops to hear how you are. Again, this is an informal greeting that people might use when passing on the street.  They may not actually want to hear how you are…and your response could be “Fine, and you?”  Normally people do not stop walking during this exchange – although they may stop.  If they do this signifies that they wish to have a short chat with you – to find out how you are doing.

“What’s up?” is another common informal greeting between friends or acquaintances.  The person is asking if anything is new with you or what you are on your way to do at this moment.  Your response could be “nothing much, and you?” or you could say that you are just on your way to the coffee shop to get a coffee and would they like to join you?

*******************

General Social Rules

It is a cultural thing in North America to shake hands when meeting someone for the first time. Each subsequent time you see this person they may stick out their hand (to shake hands) in greeting. This does                      not always happen so it is best to let the other person offer their hand first.

Westerns generally do not stand too close to each other when speaking.  A general rule to                 follow is to stand about an arm’s length away when speaking.

People normally line up according to the principle of “first-come, first-served.” They may get angry if you push ahead in a line-up instead of waiting your turn.

Most Westerns do not smoke. When you are in people’s homes, you should always ask their permission to smoke. If they do not smoke themselves, they may ask you to go outside to smoke.

You should always arrive on time — at school, at work and for any meeting. People who are late often may be fired from their jobs or suspended from school. Many Westerns will not wait                                               more than 10 or 15 minutes for someone who has a scheduled meeting. For social                                                  events, people expect that you will arrive within half an hour of the stated time.

Westerns respect the natural environment and expect people to avoid littering (dropping waste paper and other garbage on the street or throwing it out of your car). They will expect you to carry your garbage until you can find a proper garbage can.

Bargaining for a better price is not common in North America, but there are some exceptions. For example, almost everyone bargains for a better price when buying a car or a house, or other expensive items such as furniture. People who sell things privately may also bargain.

Rules 3 – 7 from http://www.ebridge.tv/ciop/pdf/M6-THE_WESTERN_WAY.pdf

It’s time to Change your Old Attitudes

Rather as living in China–where there are so many people to compete with you, to give almost unlimited service to you, to find examples to follow, to constraint you with all kinds of hidden rules, to distort your moral characters and personalities, to conceal your real purpose to be and so on—this place is good enough for you to open up your new life with abundant resources and living space and moderate policy. However, this place is not the heaven where you can do whatever you want to. The cultural stress is still pushing you to do the right or generally expected things. So, you may want to change your living attitudes facing at the changed cultural environment, otherwise, your life will not become easier than before.

First of all, always be ready for new things. To be open-minded is the best way to adjust to the new culture. If you still follow your inertia (here, I mean “previous or long-held dull habits which cannot be easily changed”. Actually, this is a dramatic difference between oriental and western cultures. In traditional Chinese culture, major oriental school believes people are born with purity, with perfectness. However, some people misconstrue this believe and keep their habits or thoughts unchanged–even when facing at a totally new environment–and being inactive to social activities, which may “bring in” impurity to them. While western people may believe everyone is born with crimes, they need to atone for their crimes. So, western people seem willing to actively adjust themselves to a new environment, while not so for some Chinese people), you may subject to considerable resistance. Feel free and active to communicate with people who can help you to better adjust to the new environment, to speak English and employ your new “mind” with everyone you can communicate with. You will find you are leading your life easier and more comfortable than ever before. The following tips are just one recommended list to check when you want to avoid cultural conflict.

1. Always think of your contribution to the community you are in. People would like to cooperate with those who can benefit themselves. If you can only “inquire” questions with others, even in a very “modest” way as Chinese culture told you, you may be not so welcome. In contrast, try to “discuss” problems with them, and contribute your own ideas and make the solutions useful to the people involved as well, then you will be welcomed. For the same reason, “silence” and other things to avoid interpersonal conflicts are also not always as good as “gold”. You’d better show you are conversant at some skills and have different ideas, or can do something down-to-earth. When you are asked to give a feedback, you are mostly expected to give a justified assessment, while a totally “flatter” is a real flop. The same “golden things” as in China are responsibility, leadership, affection, creativity and other good personalities that can make the world a better place. Make sure you are accumulating this kind of “credits” and show them to other people through all kinds of cooperation with them (having dinner or party with them is not the best way to establish the relationship and make yourself known well). Try to do the right things and have your own principles to make your life and your personality better and better, even that may make you different. It is welcomed to be unique than just to follow others. When you are about to hunt a job, people who benefit from you and know you are different most possibly would like to write a strong reference letter for you and help you find a good job, which is very suitable to you. As an example, when you come across someone being in trouble, try to help him/her out if you can, or to find someone else to help if you cannot, not come to “weiguan” (围观) or even to laugh at him/her–you should create “positive environment” to anyone’s normal lives, not the negative one.

Use your knowledge and logic as often as possible. Perfect your personality and principles with rationality to make your life, your health, your family and your friend’s lives better and better. If you are still like to follow the primary “animal instinct”, to be lazy, unhealthy, greedy, irrational and so on, or even to pass these attitudes on to others (such as through introducing others to smoke, or urging somebody to drink spirits/strong wine), then you will be thought to be uncultivated. You know what is good or bad, right? People who will be ridiculed are those who cannot use what they have learnt while preferring to laugh at other people who use their logic to do “weird” things. Anyone can and should be different from others. Any way, you are expected to make your own contribution to the world, as long as you are responsible for your behavior and the predictable results.

At the same time, focus your attention on the practical benefits or impacts, while “face”, “relationship” and any other “decorated” things are less significant. Sometimes, you may need to “lose your face” to say “sorry” when you did wrong things, you may need to “lose your face” to inquire experiments from other people, you may need to simplify your party’s decoration to save your expense, to cut your warm-up activity or greeting words in your conversations or emails… It is not necessary to buy expensive gifts to your friends on festivals, or to always agree with people even when you know they are wrong just to keep your “friendship” with them. You will find people, here, are really practical and you should be practical too. Save your time and complete the most important thing first. Once the “goal” is realized, you are done; once you are proven valuable to other people, you are welcomed. And people will help you mainly because they think you deserved it, less likely because they have some relationship with you. You can and should have your own principle or hobbies, even if different from others, such as wear your hat in class–which may be a dishonor behavior in some places of China–while if it will not actually hurt others. Certainly, sometimes decoration can produce a better effect than a direct way. But in general occasion, please avoid making your words too implicit or concealing your mind or even making up a beautiful lie, especially when you are in trouble, that helps you nothing.

2. Keep respecting people, rules and reality. We believe you are very smart and competitive, since you have been a member of this highly respected university. However, this is not your passport to pass through another customer in store without saying “excuse me”, or to take too many free stuff from the charitable organization when you actually can afford basic living expense, or to contempt a barber’s work without paying any tips nor saying “thank you”, or to cross the road when the lamp is still red without feeling any guilty, or to think you have mastered the knowledge you learned without doing any homework… If you are still insistent on doing so, you may are diverging from the spirit of the society: equality, mutual respect, gratitude, trust, fair, just, redemption, practice, all of which can finally make you and everyone else in the society free of trouble. Your degree or power or money or any other properties are good only when you are using them to do right things. And what’s more, as widely accepted, “Wealth without work”, “Pleasure without conscience”, “Knowledge without character”, “Commerce without morality”, “Science without humanity”, “Worship without sacrifice”, “Politics without principle”, “Rights without responsibilities” and so on are the blunders of the society, and are disgusted widely by people. So, check if you are crossing any of the lines, like “Knowledge without character”. In return, you and your rights will be respected by others, too.

Learn to trim up your life with schedules, self-consist rules and common agreements. This may be the best way to free both yourself and others from worries behind. Setup your present goals and realize it step by step, make appointment with others in advance, respect your partner’s habits and work out an agreement with your roommate about how to better share the utilities and ease living schedule in your apartment and perhaps write them down, talk about your right and responsibility (including expected working hours) with your supervisor and so on. These habits will also increase your efficiency if you can carry it on strictly. In fact, if you are a RA or TA, your supervisor is more expect you work efficiently than work over time. To be good, don’t attempt to use your intelligence to destroy the commonly agreed rules, you are clever enough to optimize your habits and play well under the games rules, aren’t you? But it is not necessary to be too shame to claim your demands with your partner. And being in neither overload nor disorder will help you and others considerably.

Redefine your happiness with spiritual pursues, it’s no longer worth your insistence on money stuffs or greedy to power. Most of the honorable graduated students from your University will enjoy well-off lives if staying in North America. Try to do something really interested to you. You can even think something big, like to start your own business when you are in university. As a friend of mine told me, open a new company is well welcomed in North America, and over one-third of students in UC Berkley have their own or joint companies when they are still students in the university. But it is no worth to do something harm to you, to your family or to any others, just for being the best, or for getting more money or power. More power is not necessarily meaning more privilege, and it is always true that “with more power, comes with more responsibility”. And sometimes, money or time is not necessary a must paid cost, you can use your make a double-win cooperation to win what you need.

3. Spend your time on the most important things to you, and exhilarate your capabilities. It’s unnecessary to compromise too much in order to keep relationship with others. “Forbearance” and aimless “relationship” cannot help you better your life in most cases. “Birds of a feather flock together.” If you are shown useful, there will be many people after you. Otherwise, none will keep long relationship with you. The easiest way to make your career friends or “network” is to interact with your target group and to show your genius professionally. Certainly, some professional conferences and social networks (such as http://www.linkedin.com/) can help you easily access to professional communities. “Network” in Western context is not the same thing as it is in China. People would like to help you enter the right position corresponding to your abilities and interests shown up, and they themselves get reward some days. They will not recommend you to an overqualified position only out of the personal relationship with you—this may make them lose credit if you fail in that position.

Now, let’s enjoy the bounteous resources, and build up our lives in a new way. Good Luck!

Where to Find Help

If you feel that you may be experiencing problems with cultural adjustment talk to someone about it.  You can talk to friends and to the good people at the University International Centre (UIC), who are always there to listen and help.  They can suggest other resources on campus that you can take advantage of as well.

Remember that even when you are trying to understand the Western culture, the adaptation process is one that all new students are going through.  Most students coming to the university are not from Kingston so there is an adjustment period for them as well.

Get involved with clubs, sports, and societies earlier.  Work out at the gym.  Volunteer. They are great ways to get out, get involved and make friends!

Do not isolate yourself and think that everything is harder for you.

Life can be much easier when you share time with friends and practice other enjoyable activities.

Visit the UIC for a coffee, a game of table tennis or just to talk.

Finally, we want you to remember that your home culture is the one that is most important to you. Hold that dear to you as that has made you the special person you are.  To be successful in the Western culture just requires learning a few new cultural rules and adapting your behaviour in certain situations…just like Westerns would have to adapt some of their behaviours if they visited your home culture.

Resources

Learn more about North America, especially Canada, at http://www.intercultures.ca/cil-cai/overview-apercu-eng.asp?iso=ca (pass your cursor over the highlighted words under the heading Cultural Information and click on the topics that interest you.)

*********************************

Tips on studying or working in North America:

1. You can use your own way to solve the problem set. Even if you are diverged from the standard answer, once your answer is proved self-consistent, you can still get a high mark. The main purpose of assignments or examinations is to check if you have understood the spirit of the course and are able to use them to solve practical problems.

2. Only take the courses that are useful to you in a limited time. But be sincere to study it. Don’t take more than you can chew. One or two course in a term is enough for a graduate with RA work.

3. For a graduate student, if you are paid for 10 hours TA work every week, then it is not worth spending more times on it, unless you are especially interested in it. It is better to make a timer to count how much time you spent on every unity work. But this is not suitable to your RA work.

4. If you believe your examination is not fair to you, you can definitely make a complaint to your teacher or advisor. This is your right to do so.

***********************************

Tips on cooking healthily and efficiently

1. Capture some basic knowledge on nutrition and cooking if you cook by yourself. Good taste is unnecessary  to mean your food is nutritious. To keep healthy, select your food and cook approaches carefully.

2. Cook the vegetables in the Chinese way will cause Vitamins easily lost. And any vegetables cooked and then stored longer than three days will lose almost all Vitamins even if you store them in the fridge.

3. Don’t expect your kitchen ventilator can remove the smoke of cooking efficiently. Reduce your oil and seasonings being used when cooking as much as possible. Add them in your plate can also give you a delicious taste. While this can efficiently prevent the smoke and flavour from pervading everywhere, and reduce your work to clean your cooker and the zone neighboring your stove.

4. Overintaking elements and calorie is not healthy, it may cost extra “cleaning” work to prevent these abundant energy and chemical substraction from causing illness. But in most cases, this cleaning work is not thorough and will bring you unnecessary sickness in a long run. So, control your intake energy and elements in dinner is more important than clean extra matter later after your eating.

***********************************

Tips on English learning

1. Create opportunities to communicate with native speakers as much as possible.

2. Recite some classic English articles can help you better master the language.

3. Mimic the native speaker’s pronunciation and intonation, speak after original taps or MP3 records and repeat it until you can nearly speak them out as similar as the original records do without the help of the record player. Times of repeating is more important than the number of particles you have practiced. This can help you improve your oral English dramatically in a short time.

4. Write some English materials everyday. Translating and proofreading with a standard bilingual (Chinese-English) material may help you quickly capture the writing skills.

5. When you come across a new word and phrase, take a note or by other means to record it. Recall it within a day for many time, and try to use it in your daily life. Day after day, you can have a considerable vocabulary.

6. Get help from your International Service Center or English Learning Service department. For instance, the Queen’s University International Centre (QUIC) is the service center for international students. It has two programs designed for newcomers to practice their English skills. One is the English Language Conversation Group which meets at QUIC every Thursday evening at 5:30.  This program is run by volunteers and is a fun and informal way to practice your English conversation in a very supportive environment.  The other program is the English Language Buddy Program.  For this program you fill in a form to request a “buddy” and will be matched with a native English speaking buddy.  Normally buddies meet once a week to chat and learn about each others’ lives as they practice English conversation.  To learn more about these programs visit  http://www.quic.queensu.ca/incoming/els.asp

Posted in Lives and Communities | Tagged , , | Leave a comment

Manage your computer’s memory usage in LInux

Overview of memory management

Traditional Unix tools like ‘top’ (introduced later) often report a surprisingly small amount of free memory after a system has been running for a while. For instance, after about 3 hours of uptime, the machine I’m writing this on reports under 60 MB of free memory, even though I have 512 MB of RAM on the system. Where does it all go?

The biggest place it’s being used is in the disk cache, which is currently over 290 MB. This is reported by top as “cached”. Cached memory is essentially free, in that it can be replaced quickly if a running (or newly starting) program needs the memory.

The reason Linux uses so much memory for disk cache is because the RAM is wasted if it isn’t used. Keeping the cache means that if something needs the same data again, there’s a good chance it will still be in the cache in memory. Fetching the information from there is around 1,000 times quicker than getting it from the hard disk. If it’s not found in the cache, the hard disk needs to be read anyway, but in that case nothing has been lost in time.

To see a better estimation of how much memory is really free for applications to use, run the

‘free’ command

 $ free -m

The -m option stands for megabytes, and the output will look something like this:

 total used free shared buffers cached
Mem: 503 451 52 0 14 293
-/+ buffers/cache: 143 360
Swap: 1027 0 1027

The -/+ buffers/cache line shows how much memory is used and free from the perspective of the applications. Generally speaking, if little swap is being used, memory usage isn’t impacting performance at all.

Notice that I have 512 MB of memory in my machine, but only 503 is listed as available by free. This is mainly because the kernel can’t be swapped out, so the memory it occupies could never be freed.

There may also be regions of memory reserved for/by the hardware for other purposes as well, depending on the system architecture.

Other linux commands to check the memory status includes:

vmstat command

Type vmstat command at shell prompt:

$ vmstat

Output:

procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
r  b   swpd   free   buff  cache   si   so    bi    bo   in    cs us sy id wa
1  0      0 131620  35432 341496    0    0    42    82  737  1364 15  3 81  1

top command

Type top command at the shell prompt:
$ top
Sample outputs:

Fig.01: top command displaying used memoryFig.01: top command displaying used memory 

To exit from top command type q key. Read man page of free, vmstat, top command for more information.

Alternatively, you can also use the GUI tools to show the system information:

GNOME Desktop: GUI Tool

The Gnome System Monitor application enables you to display basic system information and monitor system processes, usage of system resources, and file systems. You can also use System Monitor to modify the behavior of your system. You can start System Monitor by visiting System menu > Choose Administration > System Monitor option. Or type the following command at the shell prompt:

 
gnome-system-monitor

Sample outputs:

Fig.02: Linux See Memory Usage With GUI System Monitor ToolFig.02: Linux See Memory Usage With GUI System Monitor Tool 

Break the mysterious 880 MB limit on x86

By default, the Linux kernel runs in and manages only low memory.This makes managing the page tables slightly easier, which in turn makes memory accesses slightly faster. The downside is that it can’t use all of the memory once the amount of total RAM reaches the neighborhood of 880 MB. This has historically not been a problem, especially for desktop machines.

To be able to use all the RAM on a 1GB machine or better, the kernel needs recompiled. Go into ‘make menuconfig’ (or whichever config is preferred) and set the following option:

Code:

  Processor Type and Features ---->
  High Memory Support ---->
   (X) 4GB

This applies both to 2.4 and 2.6 kernels. Turning on high memorysupport theoretically slows down accesses slightly, but according to Joseph_sys and log, there is no practical difference.

The difference among VIRT, RES, and SHR in top output

VIRT stands for the virtual size of a process, which is the sum of memory it is actually using, memory it has mapped into itself (for instance the video card’s RAM for the X server), files on disk that have been mapped into it (most notably shared libraries), and memory shared with other processes. VIRT represents how much memory the program is able to access at the present moment. RES stands for the resident size, which is an accurate representation of how much actual physical memory a process is consuming. (This also corresponds directly to the %MEM column.) This will virtually always be less than the VIRT size, since most programs depend on the C library.

SHR indicates how much of the VIRT size is actually sharable memory or libraries). In the case of libraries, it does not necessarily mean that the entire library is resident. For example, if a program only uses a few functions in a library, the whole library is mapped and will be counted in VIRT and SHR, but only the parts of the library file containing the functions being used will actually be loaded in and be counted under RES.

The difference between buffers and cache

Buffers are associated with a specific block device, and cover caching of filesystem metadata as well as tracking in-flight pages. The cache only contains parked file data. That is, the buffers remember what’s in directories, what file permissions are, and keep track of what memory is being written from or read to for a particular block device. The cache only contains the contents of the files themselves.

Corrections and additions to this section welcome; I’ve done a bit of guesswork based on tracing how /proc/meminfo is produced to arrive at these conclusions.

How to free Cache

A way to clear out the cache being used. Simply run the following command as root and the cache will be cleared out.

Linux Command

sync; echo 3 > /proc/sys/vm/drop_caches

Or, you use the following script to do this, so no need to type commands each time:
=======================
#!/bin/bash
clear
sync
su -c “echo 3 > /proc/sys/vm/drop_caches”
exit
=====================
Put the above (betwen the lines) code in a text file (save to your desktop).
On Ubuntu, right click document, and tick “allowing executing” under properties > permissions. Whenever you want to run, double click and then select “run in terminal” at dialog box. You will be promoted for root password. Other distros you might have to play around a bit to see how to run, or run from bash command line.
Then your computer will be free to frolic on the wide open plains of its empty RAM!

Manage Swappiness (2.6 kernels)

Since 2.6, there has been a way to tune how much Linux favors swapping out to disk compared to shrinking the caches when memory gets full.

ghoti adds: When an application needs memory and all the RAM is fully occupied, the kernel has two ways to free some memory at its disposal: it can either reduce the disk cache in the RAM by eliminating the oldest data or it may swap some less used portions (pages) of programs out to the swap partition on disk. It is not easy to predict which method would be more efficient. The kernel makes a choice by roughly guessing the effectiveness of the two methods at a given instant, based on the recent history of activity.

Before the 2.6 kernels, the user had no possible means to influence the calculations and there could happen situations where the kernel often made the wrong choice, leading to thrashing and slow performance. The addition of swappiness in 2.6 changes this. Thanks, ghoti!

Swappiness takes a value between 0 and 100 to change the balance between swapping applications and freeing cache. At 100, the kernel will always prefer to find inactive pages and swap them out; in other cases, whether a swapout occurs depends on how much application memory is in use and how poorly the cache is doing at finding and releasing inactive items.

The default swappiness is 60. A value of 0 gives something close to the old behavior where applications that wanted memory could shrink the cache to a tiny fraction of RAM. For laptops which would prefer to let their disk spin down, a value of 20 or less is recommended.

As a sysctl, the swappiness can be set at runtime with either of the following commands:

 # sysctl -w vm.swappiness=30
 # echo 30 >/proc/sys/vm/swappiness

The default when linux boots can also be set in /etc/sysctl.conf:

File: /etc/sysctl.conf
# Control how much the kernel should
#favor swapping out applications (0-100)
vm.swappiness = 30

Some patchsets allow the kernel to auto-tune the swappiness level as it sees fit; they may not keep a user-set value.

(I mainly edited the content from these three sites, and sincerely thanked the authors of http://www.scottklarr.com/topic/134/linux-how-to-clear-the-cache-from-memory/http://www.cyberciti.biz/faq/linux-check-memory-usage/ and     http://www.linuxhowtos.org/System/Linux%20Memory%20Management.htm)


Xiaodong

Posted in Linux and Open Sources | Tagged , , | 1 Comment

Hello world!

Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!

Posted in My Researches | 1 Comment

Happy new year!-)

^_^

Posted in Lives and Communities | Leave a comment