1490f0df0228a7881fc78a16c58c96dc15197364
[platform/core/csapi/system.git] / Tizen.System / RuntimeInfo / MemoryInformation.cs
1 /*
2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3 *
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16
17 using System;
18 using System.Collections.Generic;
19 using System.Linq;
20 using System.Text;
21 using System.Threading.Tasks;
22
23 namespace Tizen.System
24 {
25     /// <summary>
26     /// Memory information.
27     /// </summary>
28     public class SystemMemoryInformation
29     {
30         internal SystemMemoryInformation(Interop.RuntimeInfo.MemoryInfo info)
31         {
32             Total = info.Total;
33             Used = info.Used;
34             Cache = info.Cache;
35             Free = info.Free;
36             Swap = info.Swap;
37         }
38         /// <summary>
39         /// Total memory (KiB)
40         /// </summary>
41         public int Total { get; internal set; }
42         /// <summary>
43         /// Used memory (KiB)
44         /// </summary>
45         public int Used { get; internal set; }
46         /// <summary>
47         /// Free memory (KiB)
48         /// </summary>
49         public int Free { get; internal set; }
50         /// <summary>
51         /// Cache memory (KiB)
52         /// </summary>
53         public int Cache { get; internal set; }
54         /// <summary>
55         /// Swap memory (KiB)
56         /// </summary>
57         public int Swap { get; internal set; }
58     }
59
60     /// <summary>
61     /// Memory information per processes
62     /// </summary>
63     public class ProcessMemoryInformation
64     {
65         internal ProcessMemoryInformation(Interop.RuntimeInfo.ProcessMemoryInfo info)
66         {
67             PrivateClean = info.PrivateClean;
68             PrivateDirty = info.PrivateDirty;
69             Pss = info.Pss;
70             Rss = info.Rss;
71             SharedClean = info.SharedClean;
72             SharedDirty = info.SharedDirty;
73             Vsz = info.Vsz;
74         }
75         /// <summary>
76         /// Virtual memory size (KiB)
77         /// </summary>
78         public int Vsz { get; internal set; }
79         /// <summary>
80         /// Resident set size (KiB)
81         /// </summary>
82         public int Rss { get; internal set; }
83         /// <summary>
84         /// Proportional set size (KiB)
85         /// </summary>
86         public int Pss { get; internal set; }
87         /// <summary>
88         /// Not modified and mapped by other processes (KiB)
89         /// </summary>
90         public int SharedClean { get; internal set; }
91         /// <summary>
92         /// Modified and mapped by other processes (KiB)
93         /// </summary>
94         public int SharedDirty { get; internal set; }
95         /// <summary>
96         /// Not modified and available only to that process (KiB)
97         /// </summary>
98         public int PrivateClean { get; internal set; }
99         /// <summary>
100         /// Modified and available only to that process (KiB)
101         /// </summary>
102         public int PrivateDirty { get; internal set; }
103     }
104 }