Skip to main content
Samsung Developer Program

Memory Consumption Test

This test module subjects your app to two test cases that:

  • Monitor memory usage while your app:
    • launches
    • undergoes Monkey Test input events
    • has the display screen turned off and then back on
    • is taken into background and then foreground modes
    • is terminated
  • Measure total suspected memory leakage by your app after garbage collection.

The test module then determines and logs the following data:

Heap size (Native heap size + Dalvik heap size, in KB) Amount of heap memory your app has access to for the execution of tested app functions.
Heap allocation (Native heap allocation + Dalvik heap allocation, in KB) Amount of heap memory reserved for your app during the execution of tested app functions.
Heap free (Native heap free + Dalvik Heap free, in KB) Amount of heap memory that remains unallocated during the execution of tested app functions.
Total suspected memory leakage (in MB) Combined amount of memory leak suspects for all Java classes.


Test results consist of memory usage and suspected leakage measurement; graphs of usage for tested app activities, and logs of usage amounts for tested app activities; and suspected leakage data presented via Eclipse Memory Analyzer.

NOTE:   Test results do not indicate whether your app meets memory usage or leakage criteria.
You must evaluate the test results and determine whether or not your app meets your criteria.

Test Sequence

  1. During app operations, the test monitors test device memory to determine heap size, allocation, free, and suspected leakage.
  2. During app usage and idle modes, the test measures app heap memory usage.
  3. During app browsing, the test measures app heap memory allocation.
  4. After garbage collection, the test measures suspected memory leaks.

Test Results

The following results are available by clicking the Memory_Consumption_Test link in the Test Results Summary page (summary.xml), or by opening the Memory_Consumption_Test.xml file in the unzipped file directory.  In the Test Module Results page, you can filter to show all or only those test cases that were blocked.

Test_Results_Memory_Consumption.png

Case ID

Unique names of the module's test cases.

Purpose

Test case 1:

1. Measure heap memory usage during tested app activities and idle modes.

2. Determine and graph log heap size, heap allocation and heap free.

3. Log memory data.

Test case 2:

Measure suspected memory leakage after garbage collection.

Status

Current state of testing the app via the test case:

Completed     All testing has finished.

Result

Fundamental outcome of running the test case:

MemoryConsumption_heapMemoryUsage_graph

[Blank]       Memory usage was or was not measured, logged, and graphed. See attachment for details.

Blocked      An internet connection could not be established OR the test device could not connect to the test server.

MemoryConsumption_memoryLeaks_suspected_leaks

[Blank]       Memory leakage was or was not measured, logged, and graphed.  See attachment for details.

Blocked      An internet connection could not be established OR the test device could not connect to the test server.

 

Comment

Information about the testing and test results
NOTE:  Each test case results in only 1 of the following.

Test case 1:

  • Memory usage was measured.
  • Memory usage was not measured.

Test case 2:

  • Suspected memory leakage was measured.
  • Suspected memory leakage was not measured.

Data File

Files with test case results data and information:

Log or Attachment         Link to test log (see the following sections).

Test Case 1 Memory Usage Attachment

Upon test completion, the test results attachment file  Memory_Consumption_Test.txt is generated, which contains graphs and raw data of memory usage.

Memory Usage Graphs

Test_Report_Memory_Consumption_Case1_Log.png

Memory heap allocation and usage graphs contain the following results.

Heap Allocation per Activity

Amount of heap memory (KB) reserved for the app during the execution of tested app functions.

Heap Free per Activity

Amount of heap memory (KB) that remains unallocated during the execution of tested app functions.

Heap Size per Activity

Amount of heap memory (KB) that the app has access to for the execution of tested app functions.

App and Testing Functions

Memory usage measured for the following:

Launched          App is started.

Monkey             Monkey Test unit test input events are applied.

Screen off         App runs and display screen is turned off.

Screen on          App runs and display screen is turned on.

Background      App runs in the background.

Foreground      App runs in the foreground.

Monkey             Monkey Test unit test input events are applied.

Closed                App operation is terminated.

Memory Usage Raw Data Files

Memory usage raw data for each app and testing function is available in the data files.

Test_Results_Memory_Consumption_Case1_Raw_Data.png

Each file contains the following memory information recorded during testing.  
For details about file data, see https://developer.android.com/studio/profile/investigate-ram.html#ViewingAllocations.

NOTE:  When memory information cannot be recorded for an app or test function, and the associated log is generated with the following message: No process found for: [application package name]

Test_Results_Memory_Consumption_Case1_Raw_Data2.png

Test Case 2 Suspected Memory Leak Attachment

Test_Results_Memory_Consumption_Case2_Graph.png

The Leak Suspects webpage and all of its subpages are generated by the Eclipse Memory Analyzer.

From the Leak Suspects webpage, you can access all of its subpages by clicking Table of Contents.

Test_Report_Memory_Consumption_Case2_TOC.png

For details about the contents of Leak Suspects webpage and all of its subpages, click Eclipse Memory Analyzer to go to its website (http://www.eclipse.org/mat/).

Test_Results_Memory_Consumption_Case2_MAT.png

  • Was this article helpful?