Форум » Clipper » Невосстановимая ошибка 332. Строки/Массивы: переполнение памяти » Ответить

Невосстановимая ошибка 332. Строки/Массивы: переполнение памяти

ttan34: Сделана тестовая процедура, которая создает и заполняет LOCAL массив 1000 строк по 20 элементов по 20 символов каждый. При выходе массив сбрасываю. Вызываю n (6) раз - и отвал с диагнозом: Невосстановимая ошибка 332. Строки/Массивы: переполнение памяти. Вопрос: что, LOCAL массивы тоже не очищаются из памяти? FUNCTION TestArr PARAMETERS n LOCAL tmp_buf :={}, s:="12345678901234567890",i FOR i:=1 to n AADD(tmp_buf,{"*",s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s}) @ 15,40 SAY ASTR(i) NEXT tmp_buf:={} RETURN

Ответов - 3

Dima: 332 String/Array memory overflow The maximum capacity of the Segment Virtual Object Store (SVOS) system has been exceeded. Because of the dynamic nature of SVOS, it is impossible to state exactly when this error will occur (see the Release Notes database in Norton Guides, "5.x Notes" under "Runtime Memory Management"). In the worst case, this error will occur when slightly over a megabyte of strings and/or arrays are in use; the best case is in excess of 16 megabytes. Probably the most common cause of this error is the declaration of extremely large arrays (e.g., local aArray[500][300]). Every array element requires memory to store (even if its value is NIL). The number of array elements in an array is determined by multiplying the number of elements in every dimension and adding the sum of all dimensions except for the last. For example, a 500 by 300 array has (500 x 300) + 500, or 150,500, elements. As every array element in CA-Clipper requires 14 bytes, this amounts to 150,500 x 14, or 2,107,000 bytes -- well in excess of one megabyte and, therefore, potentially dangerous. Action: Reduce the size and/or number of strings and arrays that are active at any one time. Declare as many string variables and arrays LOCAL as possible. Note: There is no benefit gained by reusing arrays. CA-Clipper is much more efficient when strings and arrays are thrown away and rebuilt often rather than kept around unnecessarily for long durations.

Dima: Юзай Harbour

Andrey: Dima пишет: Юзай Harbour +1



полная версия страницы