This can be achieved using a technique called <span class="definition">[[!wikipedia Cold_boot_attack desc="cold boot attack"]] </span>. To prevent this attack, the data in RAM is overwritten by random data when shutting down Tails. This erases all traces from your session on that computer.
Moreover, an attacker having physical access to the computer *while Tails is running* can recover data from RAM as well. To avoid that, learn the different methods to [[shutdown Tails|doc/first_steps/shutdown]] rapidly.