<div dir="ltr">Hi all,<div><br></div><div><a href="https://docs.oracle.com/en/java/javase/19/docs/api/java.desktop/java/awt/GraphicsDevice.html#getAvailableAcceleratedMemory()">getAvailableAcceleratedMemory</a>'s implementation (and lack thereof) is in conflict with the documentation, making it quite problematic.</div><div><br></div><div>Windows is the only OS that has it implemented; macOS and Linux will return -1. The bigger problem is that the return type is an int, which can't represent the amount of bytes in modern systems. Representing the amount of bytes in video memory with a signed 32-bit integer has a cap of 2047MB. My GPU has 6x that amount.</div><div><br></div><div>Windows' impl uses <a href="https://learn.microsoft.com/en-us/windows/win32/api/d3d9helper/nf-d3d9helper-idirect3ddevice9-getavailabletexturemem" target="_blank">this D3D function</a>, returning an <i>unsigned</i> 32-bit integer, closest to the actual amount of bytes it can represent--ending up with a negative number when it's signed. The documentation says "A negative return value indicates that the amount of accelerated memory on this GraphicsDevice is indeterminate." Technically true, but less than helpful.</div><div><br></div><div>The documentation for the method is... uh... probably outdated anyway as to what the method can be used for. So our remedial options are to change the documentation; implement macOS and Linux; deprecate it; change the return type; or any combination. (My thoughts are for deprecating.)</div><div><br></div><div>What should we do?<br><br>-SWinxy</div><div></div></div>