2 * Copyright (c) 2016 - 2017 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 namespace Tizen.System
22 /// The class for system memory information.
24 public class SystemMemoryUsage
26 private Interop.RuntimeInfo.MemoryInfo Info;
29 /// The constructor of MemoryInformation class.
31 /// <since_tizen> 4 </since_tizen>
32 /// <exception cref="IOException">Thrown when an I/O error occurs while reading from the system.</exception>
33 public SystemMemoryUsage()
39 /// Total memory (KiB).
41 /// <since_tizen> 4 </since_tizen>
51 /// Used memory (KiB).
53 /// <since_tizen> 4 </since_tizen>
63 /// Free memory (KiB).
65 /// <since_tizen> 4 </since_tizen>
75 /// Cache memory (KiB).
77 /// <since_tizen> 4 </since_tizen>
87 /// Swap memory (KiB).
89 /// <since_tizen> 4 </since_tizen>
99 /// Update the system memory information to the latest.
101 /// <since_tizen> 4 </since_tizen>
102 /// <exception cref="IOException">Thrown when I/O error occurs while reading from the system.</exception>
105 InformationError ret = Interop.RuntimeInfo.GetSystemMemoryInfo(out Info);
106 if (ret != InformationError.None)
108 Log.Error(InformationErrorFactory.LogTag, "Interop failed to get System memory information");
109 InformationErrorFactory.ThrowException(ret);