delete-string frees <string> variable previously allocated by a Gliimly statement.
Note that freeing memory is in most cases unnecessary as Gliimly will automatically do so at the end of each request. You should have a good reason for using delete-string otherwise.
Gliimly keeps count of <string> references. So if <string> is referenced by other Gliimly statements (for instance it was assigned to another string variable in set-string, or was used in statements like write-index or write-array), then <string> may not be deleted; in such a case, unless string was declared to be of process-scope and still used in such statements, it will be deleted when the request ends. Otherwise, <string> becomes an empty string ("") after it was deleted.
Examples
Allocate and free random string:
random-string to ran_str
...
delete-string ran_str
Copied!
Free string allocated by write-string (consisting of 100 "Hello World"s):