I looked up the same question, as far as I can tell the values are stored during the put operation and it's not necessary to call preferences.end() in order to save them, you call preferences.end() when you either know you won't be doing any more reading/writing operations and you want to free resources or when you want to open a different namespace so you need to close the opened one first.