How to prevent 'table is mark as and last (automatic) repair failed'?
"marked as crashed" -- Longterm solution:  Switch from MyISAM to InnoDB.

"errno 28" -- Check the setting for tmpdir and consider changing it to a bigger dis partition.

"Out of memory" -- What is running?  Is this server hosting MySQL only?  Or does it have other things, such as a web server and PHP?  If hosting multiple apps, let's see my.cnf so we can advise on what settings to shrink.

References:


http://mysql.rjweb.org/doc.php/memory
http://mysql.rjweb.org/doc.php/myisam2innodb