I have reported a similar issue before:
which I was never able to solve (even when testing with 1 TB RAM). My idea was that I could use diamond+megan to classify contigs from a large metagenome assembly. Which would really help with this as other annotation tools are very slow. However, in the end this was not possible because daa-meganizer always gets stuck or fails at the writing step. So I had to go back to tools like PROKKA for metagenome assembly annotation.