Well I am not an expert. It depends on your use case.
You could collect your used maps in an array and check if a map is in that array to know that it is in use.
Somethin like this:
let myUsedMaps = [map1, map2, map3];
let mapToCheckIfUsed = someMap;
if (myUsedMaps.indexOf(mapToCheckIfUsed > -1)){
console.log("map already in use")
}
Another option would be traversing through your scene and check all maps. Like this:
let mapToCheckIfUsed = someMap;
scene.traverse(function(node){
if (node.material && node.material.map === mapToCheckIfUsed){
console.log("map already in use")
}
})
but this may not be as performant in a huge scene.
There are many ways to keep track of your resources. I think THREEjs is already caching textures and some other things, but unfortunately there is not much information about it. There is a THREE.Cache Class that can be enabled by setting THREE.Cache.enabled = true.
You can also use a Helper class, described in this tutorial Its using a ResourceTracker Class for disposing unused resources. You could extend/modify the example to also keep track where a resource is in use, similar to @Drumstructor 's example.
You could also make a LoadingManager Class, that keeps track of everything that was loaded and that is cloning resources instead of reloading them, or is using Instancing instead. You could also keep track of the usage here by referencing the used Obj/Mesh id.