1. Strange memory issues

Has anyone else seen anything like this? I have a program written and running as a Windows service without any problems for about 6 years now on a physical Windows 2000 server. I've bound it with both Eu3.1 and Eu4.0.3 and both run fine. Running the exact same program on a virtual Windows 2003 server starts fine, but after anywhere from 3 to 12 hours, the program crashes with a type-check error. Examining the ex.err file shows that the crash is never in a consistent location. Yesterday's test had a crash in the Get() function called from a value() function as an example. It looked like the parameter to Get was uninitialized. It seems like the O/S is moving memory around and not putting it back correctly when requested. I've disabled DEP on this machine just to rule it out as a cause with no effect. The funny thing is, my Euphoria service is the only thing having problems on this virtual server. There are a number of other services that have been running well for a year with no problem. I don't get it.

new topic     » topic index » view message » categorize

2. Re: Strange memory issues


Try locking the disk files to read-only, maybe userX-only. I useto have this problem on win95B and early winxp with Eu, so the first line in any Eu source file was

system("attrib +r "&thisfilename,0) 

Unset it before abort().

useless

new topic     » goto parent     » topic index » view message » categorize

3. Re: Strange memory issues

m_sabal said...

Has anyone else seen anything like this? I have a program written and running as a Windows service without any problems for about 6 years now on a physical Windows 2000 server. I've bound it with both Eu3.1 and Eu4.0.3 and both run fine. Running the exact same program on a virtual Windows 2003 server starts fine, but after anywhere from 3 to 12 hours, the program crashes with a type-check error. Examining the ex.err file shows that the crash is never in a consistent location. Yesterday's test had a crash in the Get() function called from a value() function as an example. It looked like the parameter to Get was uninitialized. It seems like the O/S is moving memory around and not putting it back correctly when requested. I've disabled DEP on this machine just to rule it out as a cause with no effect. The funny thing is, my Euphoria service is the only thing having problems on this virtual server. There are a number of other services that have been running well for a year with no problem. I don't get it.

Just guessing... Maybe a problem of memory locking... if the service allocate memory but use it without locking it, it may be paged out when it try to used it and that generate an exception. If so try these API call. On a VM memory as more chance to be paged out as resources are shared by many VM.

global function GlobalAlloc(atom flags, integer nBytes) 
    return c_func(iGlobalAlloc,{flags,nBytes}) 
end function 
 
global procedure GlobalFree(atom hmem) 
atom ok 
    ok = c_func(iGlobalFree,{hmem}) 
end procedure 
 
global function GlobalLock(atom hGlobalMem) 
    return c_func(iGlobalLock,{hGlobalMem}) 
end function 
 
global procedure GlobalUnlock(atom GlobalPtr) 
   c_proc(iGlobalUnlock,{GlobalPtr}) 
end procedure 
 
global function GlobalSize(atom hGlobal) 
  return c_func(iGlobalSize,{hGlobal}) 
end function 

for more information look at: memory

Jacques

new topic     » goto parent     » topic index » view message » categorize

4. Re: Strange memory issues

coconut said...

Just guessing... Maybe a problem of memory locking... if the service allocate memory but use it without locking it, it may be paged out when it try to used it and that generate an exception.


If you prohibit memory paging, won't you eventually run out of memory with the extravagant way Eu uses memory? After all, 2 gigabytes won't hold 512megs of data and the program too, and if you lock it then no other app can use that ram. Plus, it can fragment the ram, and the situation gets worse the longer the Eu app runs.

useless

new topic     » goto parent     » topic index » view message » categorize

5. Re: Strange memory issues

useless_ said...
coconut said...

Just guessing... Maybe a problem of memory locking... if the service allocate memory but use it without locking it, it may be paged out when it try to used it and that generate an exception.


If you prohibit memory paging, won't you eventually run out of memory with the extravagant way Eu uses memory? After all, 2 gigabytes won't hold 512megs of data and the program too, and if you lock it then no other app can use that ram. Plus, it can fragment the ram, and the situation gets worse the longer the Eu app runs.

useless

It's not about prohibiting memory paging, it's about locking some allocated memory the time needed to access it.

-- how to use allocated memory 
 
atom pointer = GlobalAlloc(100) 
 
atom LockedMemory= GlobalLock(pointer) -- now it can't be paged out. 
 
--peek or poke to LockedMemory 
 
GlobalUnlock(LockedMemory) -- now it can be paged out. 
 

In windows paging is done with 4096 bytes page, so this in fact lock the whole page containing this 100 bytes and only this page.

NOTE There is LocalAlloc(), LocalFree(), LocalLock() and LocalUnlock() too if that memory is private to the application.

Jacques

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu