Swap completely used with memory free

I have a Solaris 10 VM that processes are seg faulting on (no space) and swap goes from 64GB to 151MB which triggers the seg fault. The free memory is 25GB when this occurs. I have adjusted the project to use all available ram. My question is why is swap being filled with 25GB remaining?
the project is default.

Hi,

What type of machine is the VM host, what is the host OS and what is the VM OS.

Gull04

There is free memory (RAM) because the applications haven't write anything in it.

There is no more swap (assuming you are looking at "swap -s" output), because the applications have malloc'ed something like 80 GB or so and there is no more virtual memory to satisfy new allocations.

The processes are segfaulting because they do not check malloc return value.

the VM is running on Vmware 5.5, the OS is Solaris 10 64-bit. this is a threading app that spawns 5 children per report process (so at a given time there are 20 children). Thanks for the replies on this so far. any additional settings in the OS that I should look at?

You should state how much RAM is allocated to the VM, if you have capped the ZFS ARC (if ZFS is used), what commands you run to identify the RAM and swap usage and their output.

RAM is 64GB allocated to the VM swap is 32GB
it is UFS arch
i am running vmstat while processing the reports. so vmstat 1 or vmstat -S 1

You might just simply need to increase the swap area size from 32GB to 64 or 128GB.

Thanks for the reply, I don't want to add a swapfile so where are the settings for the swap volume (in my case /tmp) to be increased? I can see where it is in /etc/vsftab but not sure where it is allocated. can you tell me how to increase the swap volume please?

/tmp is a memory file system.
Please give the output of the following commands:

swap -s
swap -l
df -k /tmp
grep swap /etc/vfstab

Why? That would be by far the simplest solution.

You generally don't, what you can do is add another swap device (or swap file, as already stated.)

I added a 50GB drive and included in swap. and also a file of 40GB. this fixed the issue but was really badly written code that is causing this. I have 150GB of swap for 65GB ram. thanks to all for the help.