I’m working on a project that requires a secure posting of data from a photon. I’m using the tls embed library found here:
I have been working closely from the example provided in library. By the nature of the project, I have to send a very large chunk of data(roughly 10kb). I would like to avoid splitting it up into multiple post requests if possible. Anyways, when I try and allocate a buffer statically, I am only allow to allocate 500bytes before I get the SOS light. But when I allocate the buffer dynamically, I’m allowed up to 4kb before this happens(note that whatever the library does with the certificates takes up a lot of room). Is the stack size that much smaller on the photon than the heap? Also, even after I allocate the 4kb buffer dynamically, a call to System.freeMemory() shows that I have roughly 5kb of free memory left. What is the deal with this? Does the System.freeMemory() call give an accurate amount of memory that’s available?