swap file not present


 
Thread Tools Search this Thread
Operating Systems Solaris swap file not present
# 1  
Old 04-05-2007
swap file not present

Hello all,

We are running a 2 gig Solaris10 system. The only application that's running on the system is ours which allocates 850MB through malloc at one shot.

For some reason this malloc keeps failing saying "Resource Temporarily Unavilable"

After some investigation, found that it goes away when a swap file is added. But that is not the goal. We would want the app to run without any disk i/o or any page reloads. Everything should be off the physical memory.

Any inputs?

The config is as below
# swap -s
total: 52040k bytes allocated + 4648k reserved = 56688k used, 1542344k available

# swap -l
No swap devices configured

# vmstat 2
kthr memory page disk faults cpu
r b w swap free re mf pi po fr de sr s0 -- -- -- in sy cs us sy id
0 0 0 1498888 1706336 2 17 6 0 0 0 4 1 0 0 0 2361 234 271 0 0 100
0 0 0 1542152 1561576 0 4 0 0 0 0 0 0 0 0 0 2090 222 68 0 0 100
0 0 0 1542080 1561504 0 0 0 0 0 0 0 0 0 0 0 2078 106 55 0 0 100

# prtconf | grep Memory
Memory size: 2040 Megabytes


Assuming the OS needs 700MB to stand up and 300MB for other misc purposes, there is still 1 gig left, why does it need a swap file? Where has all my memory gone

# prstat -a
PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP
542 root 4816K 4808K cpu1 59 0 0:00:00 0.0% prstat/1
445 root 2744K 2224K sleep 59 0 0:00:18 0.0% vmstat/1
194 root 2112K 1480K sleep 59 0 0:00:00 0.0% sac/1
168 root 2704K 1328K sleep 59 0 0:00:00 0.0% cron/1
325 root 6904K 5384K sleep 59 0 0:00:00 0.0% sshd/1
203 root 3728K 2112K sleep 59 0 0:00:00 0.0% syslogd/13
183 daemon 2712K 1888K sleep 59 0 0:00:00 0.0% rpcbind/1
92 root 4248K 3680K sleep 59 0 0:00:00 0.0% nscd/24
193 root 1360K 1160K sleep 59 0 0:00:00 0.0% utmpd/1
529 root 1336K 1232K sleep 59 0 0:00:00 0.0% sh/1
186 root 9608K 8000K sleep 59 0 0:00:02 0.0% fmd/16
70 root 2560K 1864K sleep 59 0 0:00:00 0.0% syseventd/12
9 root 7072K 5192K sleep 59 0 0:00:08 0.0% svc.configd/12
7 root 15M 12M sleep 59 0 0:00:07 0.0% svc.startd/12
96 daemon 4360K 3000K sleep 59 0 0:00:00 0.0% kcfd/5
NPROC USERNAME SIZE RSS MEMORY TIME CPU
31 root 144M 101M 5.1% 0:00:38 0.0%
2 daemon 7072K 4888K 0.2% 0:00:00 0.0%



Any help would be great.

Thanks
# 2  
Old 04-06-2007
2 GB is not very much memory. By your estimate the OS is using 700MB + 300MB = 1 GB. You have 1 GB left for your app. You want to malloc 850 MB. Now you have 150 MB left for the rest of your app. And you wonder where your memory went? Smilie

You prefer that your app not swap. Well, welcome to the club. But suppose you somehow run out of memory... what should happen then? You have two choices:

1) allocate some swap so your app will continue run, albeit slower than you would like
2) allocate no swap so your app will reliably crash and burn should you run out of memory
# 3  
Old 04-06-2007
perderabo,
Well, come to think of it, there is a way to ensure everything is resident and nothing is paged by using mlockall() in your app. But, seems like this is not working without any swap file!!
# 4  
Old 04-06-2007
If you read Perderabo's reply again you will understand why.

If you have no swap, where will the other objects in memory page to?
# 5  
Old 04-06-2007
What other objects? as i mentioned before the only app on the sytem is ours. Presuming an extremely high requirement of main memory by the OS, to be 700MB and adding another 300MB for leeway. What else does the system need?

I really doubt if the OS needs 1 Gb to sustain itself. What's your though? How can I peek into the memory to see what is eating how much? Cause as pasted above, I dont see any daunting processes gobbling memory, except ours when its started of course Smilie

Quote:
Originally Posted by reborg
If you read Perderabo's reply again you will understand why.

If you have no swap, where will the other objects in memory page to?
# 6  
Old 04-06-2007
Ok, let's for a minute assume you are correct and there is no need for swap, and go about this from the other side and just to rule it out, your application doesn't do something silly like malloc 850Mb then fork ?
# 7  
Old 04-06-2007
Reborg

The app eats 1G max, not more than that.
And no forking or execing in there. Smilie
With things running fine, I observed the RSS for my app and the max it goes is 1gig.



Quote:
Originally Posted by reborg
Ok, let's for a minute assume you are correct and there is no need for swap, and go about this from the other side and just to rule it out, your application doesn't do something silly like malloc 850Mb then fork ?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

awk code to find difference in second file which is not present in first file .

Hi All, I want to find difference between two files and output only lines which are not present in second file .I am using awk and I am getting only the first difference but I want to get all the lines which are not present in file2 .Below is the code I am using . Please help to get the desired... (7 Replies)
Discussion started by: srinivasrao
7 Replies

2. Shell Programming and Scripting

Systemd errors of missing file “No such file or directory” inspite of file being present

The contents of my service file srvtemplate-data-i4-s1.conf is Description=test service for users After=network.target local-fs.target Type=forking RemainAfterExit=no PIDFile=/data/i4/srvt.pid LimitCORE=infinity EnvironmentFile=%I . . . WantedBy=multi-user.target (0 Replies)
Discussion started by: rupeshkp728
0 Replies

3. Shell Programming and Scripting

Speed : awk command to count the occurrences of fields from one file present in the other file

Hi, file1.txt AAA BBB CCC DDD file2.txt abc|AAA|AAAabcbcs|fnwufnq bca|nwruqf|AAA|fwfwwefwef fmimwe|BBB|fnqwufw|wufbqw wcdbi|CCC|wefnwin|wfwwf DDD|wabvfav|wqef|fwbwqfwfe i need the count of rows of file1.txt present in the file2.txt required output: AAA 2 (10 Replies)
Discussion started by: mdkm
10 Replies

4. Shell Programming and Scripting

File Comparison: Print Lines not present in another file

Hi, I have fileA.txt like this. B01B02 D0011718 B01B03 D0012540 B01B04 D0006145 B01B05 D0004815 B01B06 D0012069 B01B07 D0004064 B01B08 D0011988 B01B09 D0012071 B01B10 D0005596 B01B11 D0011351 B01B12 D0004814 B01C01 D0011804 I want to compare this against another file (fileB.txt)... (3 Replies)
Discussion started by: genehunter
3 Replies

5. Shell Programming and Scripting

Need unix commands to delete records from one file if the same record present in another file...

Need unix commands to delete records from one file if the same record present in another file... just like join ... if the record present in both files.. delete from first file or delete the particular record and write the unmatched records to new file.. tried with grep and while... (6 Replies)
Discussion started by: msathees
6 Replies

6. Shell Programming and Scripting

Delete a pattern present in file 2 from file 1 if found in file 1.

I have two files File1 ==== 1|2000-00-00|2010-02-02|| 2| 00:00:00|2012-02-24|| 3|2000-00-00|2011-02-02|| File2 ==== 2000-00-00 00:00:00 I want the delete the patterns which are found in file 2 from file 1, Expected output: File1 ==== (5 Replies)
Discussion started by: machomaddy
5 Replies

7. HP-UX

Swap device file and swap sapce

Hi I have an integrity machine rx7620 and rx8640 running hp-ux 11.31. I'm planning to fine tune the system: - I would like to know when does the memory swap space spill over to the device swap space? - And how much % of memory swap utilization should be specified (swap space device... (6 Replies)
Discussion started by: lamoul
6 Replies

8. Shell Programming and Scripting

How to Check whether list file present in TXT file exist or not

Hi All, I have txt file which has list of files. I have to check whether these files exist or not. Thanks supriya (6 Replies)
Discussion started by: supriyabv
6 Replies

9. UNIX for Dummies Questions & Answers

search a word in a file present in tar file

i need to search a word in the tar file. if it is present just give me the file name please help me (1 Reply)
Discussion started by: junkbuster
1 Replies

10. Shell Programming and Scripting

ls > file - Creating file containing the list of all files present in a directory

Hi All, I need to create a file which contains the list of all the files present in that directory. e.g., ls /export/home/user/*.dat > list_file.dat but what i am getting is: $ ls /export/home/user/*.dat > list_file.dat /export/home/user/*.dat: No such file or directory But I have... (1 Reply)
Discussion started by: pranavagarwal
1 Replies
Login or Register to Ask a Question