Programming guide of DebugRenderer
[platform/core/uifw/dali-toolkit.git] / docs / content / shared-javascript-and-cpp-documentation / resource-tracking.md
1 <!--
2 /**-->
3
4 # Resource Tracking {#resourcetracking}
5
6 ## Enable Logging
7
8 Setting DALI_ENABLE_LOG environment variable to RESOURCE_LOG will enable resource usage logging in DALi applications.
9 On target resource logging utilizes dlog, but this can also be used on desktop by redirecting stderr to a file.
10 The generated information includes any image files that are loaded with their dimensions,
11 GPU memory consumption, CPU RAM used and details of texture atlases created.
12
13 ## Viewing Resource Logs
14
15 dalireslog.sh is installed as part of the DALi Adaptor package and can be found in the adaptors/tizen/scripts folder.
16 The script shows a summary of memory used by resources.
17 USAGE:
18 ./dalireslog.sh [FILE]
19 if FILE isn't specified, the script will try to use dlogutil.
20
21 ### Example:
22 ~~~{.bash}
23 sh-4.1$ ./dalireslog.sh
24
25 **On a separate terminal:**
26
27 sh-4.1$ DALI_ENABLE_LOG=RESOURCE_LOG /opt/apps/com.samsung.dali-demo/bin/album.example
28 ~~~
29 Example on desktop:
30 ~~~{.bash}
31 jon-doe\@ws-1234$ DALI_ENABLE_LOG=RESOURCE_LOG blind-effect.example 2>/home/SERILOCAL/john.doe/log.txt
32
33 **On a separate terminal:**
34
35 dalireslog.sh ~/log.txt
36
37 ~~~
38
39 ### Displayed information:
40
41 |  | |
42 |--|-|
43 | 3D | amount of GPU memory used by application |
44 | MEM Atlas | amount of GPU memory used by texture atlases (usually this refers to font atlases)
45 | Number of atlases | how many texture atlases are present in memory.|
46
47 A list of files is displayed in the main view, with different color codes representing different states:
48
49 | | |
50 |-|-|
51 |CPU | resource is in memory, but hasn't been uploaded to a GL texture.|
52 |GPU | resource has been uploaded to a GL texture, bitmap buffer discarded.|
53 |CPUGPU | resource has been uploaded to a GL texture, but still present in CPU memory as well.|
54 |DISCARDED | resource has been discarded, memory freed up |
55
56 @class _Guide_ResourceTracking
57  */