Release 4.0.0-preview1-00051
[platform/core/csapi/tizenfx.git] / src / Tizen.System.Information / 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 using System.ComponentModel;
23
24 namespace Tizen.System
25 {
26     /// <summary>
27     /// Memory information.
28     /// </summary>
29     public class SystemMemoryInformation
30     {
31         [EditorBrowsable(EditorBrowsableState.Never)]
32         internal SystemMemoryInformation(Interop.RuntimeInfo.MemoryInfo info)
33         {
34             Total = info.Total;
35             Used = info.Used;
36             Cache = info.Cache;
37             Free = info.Free;
38             Swap = info.Swap;
39         }
40         /// <summary>
41         /// Total memory (KiB).
42         /// </summary>
43         public int Total { get; internal set; }
44         /// <summary>
45         /// Used memory (KiB).
46         /// </summary>
47         public int Used { get; internal set; }
48         /// <summary>
49         /// Free memory (KiB).
50         /// </summary>
51         public int Free { get; internal set; }
52         /// <summary>
53         /// Cache memory (KiB).
54         /// </summary>
55         public int Cache { get; internal set; }
56         /// <summary>
57         /// Swap memory (KiB).
58         /// </summary>
59         public int Swap { get; internal set; }
60     }
61
62     /// <summary>
63     /// Memory information per process.
64     /// </summary>
65     public class ProcessMemoryInformation
66     {
67         [EditorBrowsable(EditorBrowsableState.Never)]
68         internal ProcessMemoryInformation(Interop.RuntimeInfo.ProcessMemoryInfo info)
69         {
70             PrivateClean = info.PrivateClean;
71             PrivateDirty = info.PrivateDirty;
72             Pss = info.Pss;
73             Rss = info.Rss;
74             SharedClean = info.SharedClean;
75             SharedDirty = info.SharedDirty;
76             Vsz = info.Vsz;
77         }
78         /// <summary>
79         /// Virtual memory size (KiB).
80         /// </summary>
81         public int Vsz { get; internal set; }
82         /// <summary>
83         /// Resident set size (KiB).
84         /// </summary>
85         public int Rss { get; internal set; }
86         /// <summary>
87         /// Proportional set size (KiB).
88         /// </summary>
89         public int Pss { get; internal set; }
90         /// <summary>
91         /// Not modified and mapped by other processes (KiB).
92         /// </summary>
93         public int SharedClean { get; internal set; }
94         /// <summary>
95         /// Modified and mapped by other processes (KiB).
96         /// </summary>
97         public int SharedDirty { get; internal set; }
98         /// <summary>
99         /// Not modified and available only to that process (KiB).
100         /// </summary>
101         public int PrivateClean { get; internal set; }
102         /// <summary>
103         /// Modified and available only to that process (KiB).
104         /// </summary>
105         public int PrivateDirty { get; internal set; }
106     }
107 }