Samer
Samer

Reputation: 1980

Do you need to worry about clean up memory on restart

I have a C++ application running on an embedded system running Windows 7 Embedded. In this application, I can send a command to a batch file which can restart the whole system (eventually force closing the application). Do I need to worry about releasing the memory before restarting the system? Isn't it the same as when the user turns off the power to the system?

My system has the EWF enabled, so, restart means "Commit my changes to the system"...by calling ewfmgr c: -commit. And then run shutdown -r

Upvotes: 1

Views: 131

Answers (1)

Lightness Races in Orbit
Lightness Races in Orbit

Reputation: 385224

No, not necessarily. It depends entirely on what "restart" means to you and to your operating system. In general terms, if you want to be entirely safe, do a power cycle.

Of course, in practice, the principles of segregated per-process memory imply that once your process is gone, so is the memory that it allocated.

And no OS deserving of the title would actually leak memory across boot-ups, even warm ones.

Upvotes: 4

Related Questions