The CommandLineHistory variable seems to only exists in gap-4.7+ which I
happened to have around. The gap version we ship also keeps a history, but
does not make the global variable available.
The history can be set to a fixed maximal length (say, 3) with
SetUserPreference("HistoryMaxLines", 3);
On Friday, February 14, 2014 12:11:28 AM UTC, Volker Braun wrote:
>
> The problem with Tobias' memory leak in the GAP interface seems to be that
> GAP keeps a log of all interactive commands in the undocumented variable
> "CommandLineHistory". This quickly fills up the available RAM if things are
> done in a tight loop:
>
> sage: G = DihedralGroup(6)
> sage: tbl = G.character_table()
> sage: gap.eval('Print(CommandLineHistory)')
> '[ 124, "LoadPackage(\\"GAPDoc\\");", "LoadPackage(\\"ctbllib\\");", \n
> "LoadPackage(\\"sonata\\");", "LoadPackage(\\"guava\\");", \n
> "LoadPackage(\\"factint\\");", "LoadPackage(\\"gapdoc\\");", \n
> "LoadPackage(\\"grape\\");", "LoadPackage(\\"design\\");", \n
> "LoadPackage(\\"toric\\");", "LoadPackage(\\"laguna\\");", \n
> "LoadPackage(\\"braid\\");", \n
> "SaveWorkspace(\\"/home/vbraun/.sage/gap/tmpim5yyp\\");", \n
> "$sage1:=Group([PermList([2, 3, 4, 5, 6, 1]), PermList([6, 5, 4, 3, 2,
> 1])]);;", "__SAGE_LAST__ := \\"__SAGE_LAST__\\";;",
> "ConjugacyClasses($sage1);", \n "last;", "$sage2:=last;;", "__SAGE_LAST__
> := \\"__SAGE_LAST__\\";;", \n "Length($sage2);", "last;",
> "$sage3:=last;;", "Print($sage3);", \n "__SAGE_LAST__ :=
> \\"__SAGE_LAST__\\";;", "Irr($sage1);", "last;", \n "$sage3:=last;;",
> "$sage4:=$sage3[1][1];;", "$sage5:=$sage3[1][2];;", \n
> "$sage6:=$sage3[1][3];;", "$sage7:=$sage3[1][4];;", \n
> "$sage8:=$sage3[1][5];;", "$sage9:=$sage3[1][6];;", \n
> "$sage10:=$sage3[2][1];;", "$sage11:=$sage3[2][2];;", \n
> "$sage12:=$sage3[2][3];;", "$sage13:=$sage3[2][4];;", \n
> "$sage14:=$sage3[2][5];;", "$sage15:=$sage3[2][6];;", \n
> "$sage16:=$sage3[3][1];;", "$sage17:=$sage3[3][2];;", \n
> "$sage18:=$sage3[3][3];;", "$sage19:=$sage3[3][4];;", \n
> "$sage20:=$sage3[3][5];;", "$sage21:=$sage3[3][6];;", \n
> "$sage22:=$sage3[4][1];;", "$sage23:=$sage3[4][2];;", \n
> "$sage24:=$sage3[4][3];;", "$sage25:=$sage3[4][4];;", \n
> "$sage26:=$sage3[4][5];;", "$sage27:=$sage3[4][6];;", \n
> "$sage28:=$sage3[5][1];;", "$sage29:=$sage3[5][2];;", \n
> "$sage30:=$sage3[5][3];;", "$sage31:=$sage3[5][4];;", \n
> "$sage32:=$sage3[5][5];;", "$sage33:=$sage3[5][6];;", \n
> "$sage34:=$sage3[6][1];;", "$sage35:=$sage3[6][2];;", \n
> "$sage36:=$sage3[6][3];;", "$sage37:=$sage3[6][4];;", \n
> "$sage38:=$sage3[6][5];;", "$sage39:=$sage3[6][6];;", \n "__SAGE_LAST__
> := \\"__SAGE_LAST__\\";;", "Flat($sage3);", "last;", \n "$sage40:=last;;",
> "__SAGE_LAST__ := \\"__SAGE_LAST__\\";;", \n "Conductor($sage40);",
> "last;", "$sage41:=last;;", "$sage40:=1;;", \n "$sage40:=0;;",
> "__SAGE_LAST__ := \\"__SAGE_LAST__\\";;", "gen($sage40);", \n
> "__SAGE_LAST__ := \\"__SAGE_LAST__\\";;", "gen();",
> "$sage40:=_an_element_;;",\n "$sage42:=pi;;", "$sage43:=1.2;;",
> "Print($sage41);", "$sage44:=1*I;;", \n "$sage45:=CyclotomicField(1);;",
> "$sage46:=GeneratorsOfField($sage45)[1];;",\n "__SAGE_LAST__ :=
> \\"__SAGE_LAST__\\";;", "is_field();", "Print($sage4);", \n
> "Print($sage5);", "Print($sage6);", "Print($sage7);", "Print($sage8);", \n
> "Print($sage9);", "Print($sage10);", "Print($sage11);", "Print($sage12);",
> \n "Print($sage13);", "Print($sage14);", "Print($sage15);",
> "Print($sage16);", \n "Print($sage17);", "Print($sage18);",
> "Print($sage19);", "Print($sage20);", \n "Print($sage21);",
> "Print($sage22);", "Print($sage23);", "Print($sage24);", \n
> "Print($sage25);", "Print($sage26);", "Print($sage27);",
> "Print($sage28);", \n "Print($sage29);", "Print($sage30);",
> "Print($sage31);", "Print($sage32);", \n "Print($sage33);",
> "Print($sage34);", "Print($sage35);", "Print($sage36);", \n
> "Print($sage37);", "Print($sage38);", "Print($sage39);", \n
> "Print(CommandLineHistory);" ]'
>
>
>
> On Thursday, February 13, 2014 1:24:14 PM UTC, Tobias Weich wrote:
>>
>> Dear all,
>>
>> Im doing some numerics on symmetry reduced PDEs. For this it is necessary
>> to calculate the cahracters of some permutation group elments. In a precise
>> example I call
>>
>> character(g**k)
>>
>>
>> where character is a character of the DihedralGroup(6), g an element of
>> this Group and k an integer in range(10). If the programm runs a long time
>> then I get in a nonreprodicible manner different Errorrs from gap like
>>
>> File
>> "/usr/local/sage/sage-5.12/local/lib/python2.7/site-packages/sage/groups/class_function.py"
>> , line 279, in __call__ return self._base_ring(gap(g)._operation("^",
>> self._gap_classfunction))
>> File
>> "/usr/local/sage/sage-5.12/local/lib/python2.7/site-packages/sage/interfaces/interface.py"
>> , line 1076, in _operation raise TypeError, msg
>> TypeError: Gap produced error output
>> Error, exceeded the permitted memory (`-o' command line option)
>>
>> executing $sage21:=$sage63 ^ $sage87;;
>>
>> Or
>>
>> ** Gap crashed or quit executing '$sage53:=PermList([5, 6, 4, 2, 3,
>> 1]);;' **
>> Restarting Gap and trying again
>> Error in lines 1-3
>> Traceback (most recent call last):
>> File
>> "/projects/323aa7f2-3ee3-43cd-ac05-4a21e6b0c3f6/.sagemathcloud/sage_server.py"
>> , line 733, in execute
>> exec compile(block+'\n', '', 'single') in namespace, locals
>> File "", line 2, in <module>
>> .......
>> .some traceback of my nested funcion calls
>> ......
>>
>> File
>> "/usr/local/sage/sage-5.12/local/lib/python2.7/site-packages/sage/groups/class_function.py"
>> , line 279, in __call__
>> return self._base_ring(gap(g)._operation("^", self._gap_classfunction
>> ))
>> File
>> "/usr/local/sage/sage-5.12/local/lib/python2.7/site-packages/sage/interfaces/interface.py"
>> , line 1076, in _operation
>> raise TypeError, msg
>> TypeError: Gap produced error output
>> Error, Variable: '$sage33' must have a value
>>
>> executing $sage45:=$sage53 ^ $sage33;;
>>
>> Does anybody have a clue what is happening here? Are the group elements
>> not supposed to be exponentiated a lot of times independently?
>>
>> A possible workaround would probably be to calculate all the needed
>> characters of all group elements once and store them instead of
>> recalculating. I still would love to know what is going wrong here.
>>
>> Thanks in advance for your replies,
>>
>> Best,
>> Tobias
>>
>> P.S.
>> All this happend on the sage installation on sagemath-cloud if this is of
>> importance.
>>
>>
>>
>>
>>
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.