Currently the server code used to resolve AMD modules creates a map with all deployed JS modules before resolving anything. This has two effects:
1) Most of the data we are computing in advance won't be used for the resolution, so it's a waste of CPU and memory.
2) Because we add errors when the data is invalid we are creating lots of false positives because we are signaling as errors incorrect modules that are not being used.
Luckily, we haven't suffered any problem with this because, as the invalid data was not used, nobody noticed.
The solution will be moving the warnings/errors to a specific place in the server-AMD loader protocol (instead of reusing already existing fields which are not intended to hold errors) and don't analyze more modules than those needed (to avoid wasting CPU, RAM and generating more warnings than necessary).
This issue depends on https://github.com/liferay/liferay-amd-loader/issues/230