Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Mata and memory

From   "Jann, Ben" <[email protected]>
To   <[email protected]>
Subject   st: Mata and memory
Date   Tue, 10 May 2005 11:55:23 +0200


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

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 

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,

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)'"'

version 9.0
function something(string scalar anything)
	st_global("r(anything)", anything)

*   For searches and help try:

© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index