It is possible that mysqld could use up to
key_buffer_size + (record_buffer + sort_buffer)*max_connections = 225791 K
bytes of memory
Hope that's ok, if not, decrease some variables in the equation
225791 K = 220.5 MB of memory allocation.
220.5 MB > 128 MB.
Surely my max available memory is 128MB(RAM) + 256MB(swap) = 384MB, and thus 220.5MB is < 384MB?
This is what I don't understand. It seems it's not paging.
I don't mind so much if it's slowing down, but the thing is just plain running out of memory and yet there's plenty of swap space.
Also, the thing is under virtually no load at all. I get very few hits and it's not like there are 10s of thousands of photos. It's a very lightweight gallery and MySQL is exclusively being use for it.
Read up on the configuration variables:
key_buffer_size
record_buffer
sort_buffer
max_connections
and decide what you want to change to bring that number more in line with your system's capabilities.
I'm just doing that now, but I was under the impression that for a small Coppermine install all you needed was the defaults in MySQL. I can't see any recommended settings for MySQL here.
Edit: I've just updated it with these settings...
set-variable=max_connections=100
set-variable=sort_buffer=1M
set-variable=key_buffer_size=7M
set-variable=record_buffer=132K
Going by what I've read these seem to be recommended basic settings, with the key buffer being just about 5% of system RAM.
I've turned off InnoDB which drastically reduces the amount of memory mysqld is taking, but all this was happening before I enabled InnoDB in the first place. Anyway, I'll see what happens.