i'm using mysql 4.0.16 on a gentoo 1.4 box with a gentoo-patched 2.4.23 kernel, 1.3GHz Athlon, 512MB RAM and 20GB HD space (old hd).
i boot up to commandline, login, and top shows 440MB+ of RAM free. i launch an app i've written which begins by hitting mysql with a query against a table of ~2M records up to a few hundred bytes wide. the calculation uses date arithmetic and is calculated against almost every record, and the whole thing takes about 20 seconds. it also does an ORDER BY and a LIMIT. during this time, mysql sucks up hundreds of MB of RAM. the problem is, once it returns the resultset (which is the top-scoring records, up to a few thousand of them), i don't see the RAM getting released. i'm assuming mysql uses the RAM for an im-memory temp table to sort the results... but the ram is never freed up. from that point on, performance in general degrades on the machine, because it starts swapping. any ideas on how i can get mysql to give my ram back when it's done?
i boot up to commandline, login, and top shows 440MB+ of RAM free. i launch an app i've written which begins by hitting mysql with a query against a table of ~2M records up to a few hundred bytes wide. the calculation uses date arithmetic and is calculated against almost every record, and the whole thing takes about 20 seconds. it also does an ORDER BY and a LIMIT. during this time, mysql sucks up hundreds of MB of RAM. the problem is, once it returns the resultset (which is the top-scoring records, up to a few thousand of them), i don't see the RAM getting released. i'm assuming mysql uses the RAM for an im-memory temp table to sort the results... but the ram is never freed up. from that point on, performance in general degrades on the machine, because it starts swapping. any ideas on how i can get mysql to give my ram back when it's done?