Currently [AM creates too many directories|https://github.com/liferay/liferay-portal/blob/master/modules/apps/adaptive-media/adaptive-media-image-service/src/main/java/com/liferay/adaptive/media/image/internal/storage/AMStoreUtil.java] to store images adapted to the configured resolutions. Folders hierarchy follows the next pattern:
For example, for Liferay's default thumbnails resolution, and an image with two versions, AM creates
folders, which makes a total of 9 folders/files. Which leads to file systems quickly reach their physical limits in number of used inodes (pointers to folders/files) because this number could grow exponentially depending on the number of resolutions configured and versions of each file.
After doing some analysis with Lima team in PTR-1760, we got to the conclusion that the following hierarchy would also make sense and would save a lot of physical resources consumed by AM:
which, in our example will look like:
making a total of 7 folders/files created, and saving in this case almost a 5% of inodes, which can be very beneficial for customers.