The Device Memory API is a new web platform feature aimed at helping web developers deal with the modern device landscape, which returns how much RAM the device has in gigabytes, rounded down to the nearest power of two.
The capabilities of a client device largely depend on the amount of available RAM. Traditionally, developers had to use heuristics and either benchmark a device or infer device capabilities based on other factors like the device manufacturer or User Agent strings.
The Device Memory API gives developers the ability to do two primary things:
Device Memory API is very simple to use, just take dependency DeviceMemoryAPI of module and invoke GetDeviceMemory client action, This action has an output parameter DeviceMemory which return memory in GB.