1834136 Members
2183 Online
110064 Solutions
New Discussion

Shared ?? swap??

 
Vivek_15
New Member

Shared ?? swap??

Hi,

I am new to UNIX and this is not even one of my job duties. Don???t ask me but now I need to handle a UNIX (k200) box with Sybase on it. First thing I need to do is Sybase upgrade. I have some question about memory and swap. Total physical memory on my box is 512 MB.

What is shared memory?
What is swap?
How do they (shared memory & swap) relate to each other?
How do they (shared memory & swap) relate to physical memory?
How do they (shared memory & swap) relate to Sybase database or any database?

On my box shared memory is configured to 70MB and following is the output of swapinfo command:

Kb Kb Kb PCT START/ Kb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 524288 0 524288 0% 0 - 1 /dev/vg00/lvol2
reserve - 190596 -190596
memory 202724 34524 168200 17%

Which memory Sybase uses? I don???t know whether is it shared memory or physical memory? Probably Sybase uses shared memory. I want to allocate as much shared memory as I can.

What should I do? Should I increase shared memory? If yes, do I need to increase swap too?

By now you guys can figure out that I am lost. Please do help me.

Really counting on your help guys.

Thanks
5 REPLIES 5
Zafar A. Mohammed_1
Trusted Contributor

Re: Shared ?? swap??

Check this

http://docs.hp.com/hpux/onlinedocs/os/memwn1_4.pdf

I am posting other also

Thanks
Zafar
Zafar A. Mohammed_1
Trusted Contributor

Re: Shared ?? swap??

Vivek_15
New Member

Re: Shared ?? swap??

Thanks zafar,

First link is quite too much for me. because i don't have that complicate problem with me. there is not much in second link.

I still want to know that what are the realation between all three

Physical memory ( in my case 512 MB)
Shared Memory ( I think 70 MB)
swap (524288 + 202724 kb)

how do they restrict or help to each other?

Can i configure the shared memory more than 512 MB or what is the max? how come swap looks like more than 512 MB (physical).


Please just explain me at zero level. i am sorry if i may sounds like stupid.


Please do help me.

Thanks
James Murtagh
Honored Contributor

Re: Shared ?? swap??

Hi Vivek,

Lots of question....

1) Shared memory is a area of address space that different processes can share. There are several benefits to this technique:

You don't have multiple copies of the data taking up physical memory.
Processes can access a common data area, i.e. a database, allowing proper synchronisation of changes.

2) Swap space is an area, typically on disk, that provides a backing store to main memory. If memory is almost full certain parts of processes memory regions can be stored here until the memory utilisation decreases.

3) & 4) Most modern unix operating systems use a memory management technique called virtual memory. To go into this in any depth would take me hundred of lines I expect. The first few pages from this document should give you a good description:

http://docs.hp.com/hpux/onlinedocs/5965-4641/5965-4641.html

The total amount of virtual memory on the system is the swap area + physical memory. There is no real correlation between shared memory and swap per-say.

5) I don't know Sybase but i'd imagine, like all other DB products, it will use shared memory for the reasons in 1).

The kernel parameter shmmax determines the maximum size of a shared memory segment. This should be equal or larger than your largest DB SGA. To see the shared memory allocation use the command:

# ipcs -mob

All processes that run need to reserve swap space in case any part of their memory regions need to be paged out. If this did not happen then the process would have to be killed if the swap space reached 100%. The more memory load you place on the system, or the more processes that run, you will need to increase swap space to increase the total amount of virtual memory. Processes will not be able to start without first reserving the required swap space, hence the reserve column in the swapinfo output.

None of this is straightforward, although I have tried to make it as non-cryptic as possible. I hope it has helped a little.

Regards,

James.
Michael Steele_2
Honored Contributor

Re: Shared ?? swap??

Shared memory is common memory used by related processes for high efficiency. Sybase is one example. All shared memory can be swapped out to a reserve area if need be. Swap is the reserve area. That's the relationship shared memory and swap.

RAM is finite physical memory. If the O/S runs out of physical memory it has to have a place to go for a temporary holding area. This is swap and this is the relationship between swap and physical memory.

Here is a nice quote and link about shared memory:

"...Sharing a common memory space eliminates the need for copying or moving data to a separate location before it can be used by other processes, reducing processor time and overhead as well as memory consumption..."

http://docs.hp.com/cgi-bin/otsearch/getfile?id=/hpux/onlinedocs/939/KCParms/KCparam.ShMemParmsOverview.html&searchterms=memory%7cshared&queryid=20030415-184505

Here is a nice quote and link about swap:

Swap space is an area on disk that temporarily holds a process memory image.

http://docs.hp.com/cgi-bin/fsearch/framedisplay?top=/hpux/onlinedocs/B2355-90672/B2355-90672_top.html&con=/hpux/onlinedocs/B2355-90672/00/00/60-con.html&toc=/hpux/onlinedocs/B2355-90672/00/00/60-toc.html&searchterms=swap&queryid=20030415-185345
Support Fatherhood - Stop Family Law