Let dfs() discover only memory nodes