The program deallocvt deallocates kernel memory and data structures for all unused virtual consoles. If an argument N is given, only /dev/ttyN is deallocated.
A virtual console is unused if it is not the foreground console, and no process has it open for reading or writing, and no text has been selected on its screen.