[Scilab-users] setmemory() <= Re: Reintroducing stacksize on Scilab 6 ? was (Re: multiple element by element between large matrix and vector)

Clément David clement.david at scilab-enterprises.com
Thu Oct 1 10:15:28 CEST 2015


Hello Samuel,

> So, my questions are:
> * can't the same be implemented in Scilab 6?

No it can not be exactly the same as we no more used a stack approach
for Scilab 6.

> * If yes: is there a way to implement it in such a way that sharing 
> between global and local+intermediate variables/memory would be set 
> dynamically, in a transparent way for the user that would not have to
> specify fixed amounts for each kind of variables?

We can handle raw data for ArrayOf<T> based variables (any matrices data type). Which means that if the user allocate 100x100 double matrix, we would only check 10000*8 against the sett-ed limitation (no global / local distinction, datatype or class memory layout not included).

This approach is the simplest one and do not manage list / mlist nor user-allocated data. In my view, this is sufficient to handle the basic multiplication mistake or any other basic memory-bound operation.

In fact we can handle the allocation implementation per Scilab type so
we just have to choose what is handled or not (this does not cover
gateways allocation).

> * How the "default" buffer is initially sized in Scilab 5? Does it
> take 
> into account the available memory at the time of launching the Scilab
> session, such as it could be different from a Scilab session to the 
> other, particularly when several concurrent Scilab sessions are 
> simultaneously run on the same computer? How could it be managed in 
> Scilab 6,  while the former Scilab memory limit that became quite 
> smaller than common available RAM does no longer hold?

The static settings is defined in etc/scilab.start for Scilab 5 with
value 10000000*8 bytes for *all* datatypes. You can pass the '-mem'
argument that will modify this value at startup.

As Simon written, this is not possible to automatically handle that for
each user as Scilab's usage will vary. We just set a sane default value
(probably the same value as in Scilab 5) and allow each user to modify
it at Scilab's startup or later.

> * Is this setting a memory reservation?.. in such a way that
> increasing 
> the java heap max size makes this memory unavailable for other
> processes 
> external to Scilab, or even unavailable for other Scilab sessions 
> running on the same computer?

Yep this is static memory reservation settings (call Java Heap Space)
that can be only tuned at the JVM startup.

> * Does each Scilab session have its own java heap, or is the java
> heap 
> shared? 

This is the first case ; each OS process is independent and the Java
Heap Space is allocated per process.

> In the first case, including its setting through setmemory() of 
> a session could be meaningful.

--
Clément



More information about the users mailing list