While there could be a point in setting limits proactively, let's answer OP's question :-)
Make an Upstart script in
skype with Skype's binary name if its not
skype, and replace
500000 (as in 500000 kB = 500 M) with the limit in kB's you wish to enforce for Skype virtual memory size and
30 with the number of seconds between checks.
This job will start on startup and keep running checking for skype memory usage. After you have copied this to
sudo start skype-killer to get it going, or reboot system. If you wish to revise memory usage, edit the
skype-killer.conf and do
sudo stop skype-killer; sudo start skype-killer.
start on startup
stop on shutdown
while /bin/true; do
if $(pidof skype); then
test $(cat /proc/`pidof skype`/status | grep "VmSize:" | sed -re s,VmSize:\\s+,, | cut -d" " -f1) -gt 500000 && killall skype