free seems not work

new topic     » topic index » view thread      » older message » newer message

Hello,

i run the Euphoria 4 code below on vista and the result, noticed into the ex.err file, is
D:\Programme\euphoria\euphoria\include\std\machine.e:81 in function allocate()
Your program has run out of memory.
One moment please...
n = 10000
cleanup = 0
iaddr = <no value>
eaddr = <no value>

the 2 Giga memory line is reached, after the 3rd call to the UnCycleComplet procedure. Where is my mystake ? or the free statement doesn't release back the memory to the system ? or any idea ?

thanks for Euphoria :):):)

include std/os.e                                                    -- 
include std/console.e                                               -- 
include std/machine.e                                               -- 
--                                                                  -- 
constant                                                            -- 
    NOMBRE_CYCLE        =100,                                       -- 
    NOMBRE_CYCLE2       =200,                                       -- 
    BOUCLE              =1000                                       -- 
--                                                                  -- 
procedure WaitKeyMsg(sequence msg)                                  -- 
    integer rc_key                                                  -- 
    printf(1,"%s\r\n",{msg})                                        -- 
    rc_key  = wait_key ()                                           -- 
    printf(1,"[%d]",{rc_key})                                       -- 
end procedure                                                       -- 
--                                                                  -- 
procedure allocate_bcl(sequence ptr_liste)                          -- 
    for j=1 to BOUCLE do                                            -- 
        ptr_liste[j]=allocate(10000)                                -- 
    end for                                                         -- 
end procedure                                                       -- 
--                                                                  -- 
procedure free_bcl(sequence ptr_liste)                              -- 
    for j=1 to BOUCLE do                                            -- 
        free(ptr_liste[j])                                          -- 
    end for                                                         -- 
end procedure                                                       -- 
--                                                                  -- 
procedure UnCycleComplet()                                          -- 
    sequence ptr_liste                                              -- 
    ptr_liste = repeat(0,BOUCLE)                                    -- 
    for i=1 to NOMBRE_CYCLE do                                      -- 
        allocate_bcl(ptr_liste)                                     -- 
        free_bcl(ptr_liste)                                         -- 
    end for                                                         -- 
end procedure                                                       -- 
--                                                                  -- 
    WaitKeyMsg("Appuye sur une touche pour commencer....")          -- 
    for k=1 to NOMBRE_CYCLE2 do                                     -- 
        printf(1,"[%3d]",{k})                                       -- 
        UnCycleComplet()                                            -- 
    end for                                                         -- 
    WaitKeyMsg("Appuye sur une touche pour terminer....")           -- 
new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu