This is a test version of Biostars. For the public version, visit https://www.biostars.org.
[STAR] How to clear memory after lost --genomeLoad

Hi all,

I'm regularly using STAR and happen to play with the argument --genomeLoad. My problem is that I think a genome index is still loaded in memory but I can't find it (I tried to --genomeLoad Remove all the indexes I could find and none of them cleared the memory). I'm not sure how it happened though. I ran zUMIs that failed and I think it's related (it's using STAR to map). It's also possible that I changed some directory location that contained an index.

Anyway, is there a magical way to remove all STAR indexes in memory whatever their path? Are there other tips to clear the memory in such situation (other than rebooting the server...)?

Cheers, Mathieu

star memory

If this can help, I finally found and kill the process (that was a ghost child process from zUMIs, though zUMIs command was long ago failed) from htop. In STAR manual, it's said to use Linux commands "ipcs" and "ipcrm" though I'm not sure how it works since "ipcs" listed the same shared memory segments before and after I killed the process.

1 answer

I made myself a little bash alias for deleting any lingering shared memory segments...

alias memclear='for n in $(ipcs -m | awk -v u=$USER "\$3==u {print \$2}"); do ipcrm -m $n; done'

With that (easiest to put it in your .bashrc file, to always have it defined), you can just type "memclear" at a shell prompt, and any shared memory you have on that machine will be cleared.

How it works:

  • use "ipcs -m" to print the current list of shared memory
  • use "awk" to match lines with memory segments owned by you ($USER) and extract the ID of each
  • use "ipcrm" to delete each segment, by ID

-Erik

Hi Erik,

Thank you for your answer! :) I might use this code!

Cheers, Mathieu

Log in to answer this question.