No, you will not consume less memory in the EVM.
Per the ERC20 spec,
decimals must be a
uint8. Because of this, the actual decimals variable will always be the same cost.
Additionally, you will not have any cost savings by storing variables of token values with a smaller
decimals. In fact, it may even cost more to store a smaller value (such as
uint128). This is because the EVM is expecting to see a
uint256 and has to do more work if it is given anything different. From the docs:
When using elements that are smaller than 32 bytes, your contract’s gas usage may be higher. This is because the EVM operates on 32 bytes at a time. Therefore, if the element is smaller than that, the EVM must use more operations in order to reduce the size of the element from 32 bytes to the desired size.
Using 18 decimals is not defined in the spec, but it is common practice. Many dapp developers have programmed for 18 decimals, and there have been many instances where less have caused bugs. With this said, you may use whatever number you desire.