File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -100,16 +100,14 @@ public static URI getCloudHttpAddressUri() throws URISyntaxException {
100100 * @return the maximum memory in bytes, or Long.MAX_VALUE if not set or invalid.
101101 */
102102 public static long getMaxMemory () {
103- String maxMemoryStr = System .getenv ("SPICE_MAX_MEMORY" );
104- if (maxMemoryStr != null && !maxMemoryStr .isEmpty ()) {
105- try {
106- long maxMemory = Long .parseLong (maxMemoryStr );
107- if (maxMemory > 0 ) {
108- return maxMemory ;
109- }
110- } catch (NumberFormatException e ) {
111- // Invalid value, fall back to default
103+ try {
104+ String maxMemoryStr = System .getenv ("SPICE_MAX_MEMORY" );
105+ long maxMemory = Long .parseLong (maxMemoryStr );
106+ if (maxMemory > 0 ) {
107+ return maxMemory ;
112108 }
109+ } catch (Exception e ) {
110+ // Any exception, fall back to default
113111 }
114112 return Long .MAX_VALUE ;
115113 }
You can’t perform that action at this time.
0 commit comments