Perl is optimized to doing things fast, even at the expensive of using more memory. Under the hood, lots and lots of things happen, and Perl isn't going to waste time "erasing" memory it's no longer using.
Is there any workaround to this except me writing another XS module providing
I don't think so, and even if you're going to write C, it may be harder to than you think. Compiler might eliminate code whose effect isn't going to be seen. A year or two ago I read an article about someone who had a simalar problem as yours - but then in C. He had sensitive information in a string, and after using it, he "cleared" the content by assigning to it another string of appropriate length. However, the compiler had noticed that after the assignment, the memory wouldn't be accessed anymore - so it just optimized the assignment away.
C is probably your best option though, just make sure the compiler doesn't outsmart you.
Abigail
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.