Hi,
I have a problem with Mata that confuses me. Mata sometimes
issues an error
"cannot create <istmt1>(): insufficient memory"
although I am not doing anything that really uses a lot of
memory. Here's an example:
. local list
. forv i=1/10000 {
2. local list "`list' hellobello"
3. }
. something `list'
cannot create <istmt1>(): insufficient memory
r(3000);
The -something- command is just for illustration and
doesn't do anything complicated. It passes `list'
through Mata and returns it in r() (find the code
below).
The string containing 10000 times "hellobello" consumes
arround 110kb. How can this be a problem?
Does the 110kb local macro plug up some cache that is
used by Mata? How can this be prevented?
Many thanks for any help,
ben
PS: I'm using Stata/SE 9.0 on Windows XP
=== something.ado ===
program define something, rclass
version 9.0
syntax anything
mata: something(`"`anything'"')
return local list `"`r(anything)'"'
end
version 9.0
mata:
function something(string scalar anything)
{
st_global("r(anything)", anything)
}
end
====================
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/