# Memory size not change?

**URL:** <https://forum.dfinity.org/t/memory-size-not-change/10404>\
**Category:** Developers\
**Tags:** Functional-Programming\
**Created:** [January 21, 2022, 6:32am UTC](https://forum.dfinity.org/t/memory-size-not-change/10404 "2022-01-21T06:32:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![goose](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/goose/32/6164_2.png) [@goose](https://forum.dfinity.org/u/goose)\
**Post date:** [January 21, 2022, 6:32am UTC](https://forum.dfinity.org/t/memory-size-not-change/10404/1 "2022-01-21T06:32:50Z")

</div>

Canister status call result for nh4f6-niaaa-aaaai-abf2q-cai.  
Status: Running  
Controllers: jwlp2-oiaaa-aaaai-aaahq-cai  
Memory allocation: 0  
Compute allocation: 0  
Freezing threshold: 2\_592\_000  
Memory Size: Nat(432881527)  
Balance: 629\_361\_694\_233 Cycles  
Module hash: 0xa42d68a6d186aee112d9ef90a7745a6b2940360e848b7fe885725270fd1693ff

```
// test code
private stable var testEntries :[(Text, Text)] = [];

private var testMap = HashMap.fromIter<Text, Text>(testEntries.vals(), 0, Text.equal, Text.hash);

    public func addMap(num : Nat): async(Nat){
    var i : Nat = 0;
    let oldsize = testMap.size();
    i := oldsize;
    var total = "hhhhhhhhhhhhh";
    total := total # total;
    while(i < num+oldsize) {
        testMap.put(Nat.toText(i), total);
        i+=1;
    };

    return testMap.size();
};

```

public func clear(num : Nat): async(Nat){  
var i : Nat = 0;  
while(i \< num) {  
label labelProcessLoop for( (k, v) in testMap.entries()){  
testMap.delete(k);  
break labelProcessLoop;  
};  
i+=1;  
};

```
    return testMap.size();
};

```

I use the function addmap to fill in the canister , and the memsize reaches 329mb. Then I call clear to delete the data, and the memsize reaches 432mb； After deleting the data in the testmap, why is the memsize still 432mb, as shown above
