@mhwlng, I don’t have an answer for that one and I will defer to @zachary for that one. Obviously a quick fix is to increase your DHCP renewal time but you already knew that 
Another problem
I made an application using these libraries
-DigoleSerial
-elapsedMilli
-OneWire
-PubSubClient
so I think memory is close to full… (I don’t see memory usage in the cloud IDE)
when there is a new DHCP lease request , I see the led flash white for a while, then SOS and the red led flashed 8 times (memory full?)
I think then there is a restart and all is ok again…
Hi @mhwlng
I think that when you are getting a new DHCP lease, the Spark cloud is renegotiating a session key to use to talk the cloud. This process uses some dynamically allocated memory, which it releases back to you when it is done, but temporarily you exceed available memory.
When you reset or power up the core, this same process happens, but before your objects are allocated in memory.
Do you need the cloud? You could turn if off if you don’t need it.
I'm not sure.
I don't use publish etc.
But I do use :
The web ide
TCPClient with a domain name (for publishing to MQTT running on azure)
I don't know if the cloud is used for dns lookup?
Timestamp, which is synchronized from the cloud ?
so I think If I switch off the cloud, I would have to add code for DNS and NTP and switch to performing local updates via usb ?
The webIDE does download new firmware over the cloud connection. One trick I have used is have a pin on the core that is normally when switched high, starts the cloud connection and waits.
DNS does not need the cloud, you are getting that from your WiFi router.
For the timestamp, it depends. If you are using Time.timeStr() you need the cloud; if you are using my NTP library SparkTime, you don’t.