Disclaimer: Not trying to argue; comments below are for the sake of myth-prevention
Periplaneta americana, the American roach, has been proven to have an excellent memory. https://www.google.com/url?sa=t&source=web&rct=j&url=http://www.bioone.org/doi/pdf/10.2108/zsj.18.21&ved=2ahUKEwi-v8y4uuraAhXPtVkKHaZJAt0QFjAAegQICRAB&usg=AOvVaw2R56gPNwnVV_UMJIwIsV_h
Research has also shown that Blattella germanica (German) has long-term memory and the ability to remember cage landmarks for visual navigation.
https://www.researchgate.net/publication/255641206_HOW_DO_BLATTELLA_GERMANICA_L_AGGREGATE
I don't know what species you keep, but:
These two houseroaches belong to different superfamilies and are built similarly to most roaches; it is thus rather safe to assume that other roaches with "typical" habits have similarly good memory capacity as well (of course, some roaches with extremely unusual biology might have reduced memory capacity to improve biological fitness).
Conclusion: Your roaches' apparent poor memory is probably not a poor memory at all. One likely possibility is that they are simply just being instinctively paranoid (better to err on the side of caution) and are thus too timid to habituate to your handling when you lack food.