'How to delete data in hashmap

In my case I will have 450 data in 1 sec, then I wrap it every 50 data because I only need 50 data, but 400 data still save in temporary even I clear the hashmap data. So how to delete all data in hashmap?

Date date = new Date();
leftDataDict.put(String.valueOf(formatter.format(date)),Arrays.toString(l_data_double_arr));

if (leftDataDict.size() == 50) {
    leftDataDictCon.clear();
    leftDataDictCon.putAll(leftDataDict);
    sendToFirebase(leftDataDictCon, "Left_Insole");
    leftDataDict.clear();
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source