Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Edgar_Herrera, VoroneTZ, Akow), 973 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
memory() can be negative #446523
10/19/14 23:50
10/19/14 23:50
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline OP
User
GPEngine  Offline OP
User
G

Joined: Sep 2013
Posts: 504
California
memory() can return a negative number.

Re: memory() can be negative [Re: GPEngine] #446604
10/22/14 17:37
10/22/14 17:37
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
Theoretically yes, when less memory is used than at the begin of the simulation - but that must be a special situation. Can you give an example?

Re: memory() can be negative [Re: jcl] #446653
10/25/14 15:16
10/25/14 15:16
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline OP
User
GPEngine  Offline OP
User
G

Joined: Sep 2013
Posts: 504
California
Under wine, Zorro's memory() function gives absurd values in the range (-2GB, 2GB) apparently at random.
Quote:
Memory 210016 kb
Memory 1255794 kb
Memory -1814190 kb
Memory 953517 kb
Memory 1613223 kb
Memory -1284531 kb
Memory -799298 kb
Memory -688318 kb
Memory -1430684 kb
Memory 1377544 kb
Memory 2069407 kb
Generate Chart - please wait... ok

Re: memory() can be negative [Re: GPEngine] #446672
10/27/14 11:18
10/27/14 11:18
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
Ah, this could explain it. memory() uses a Windows function, GetProcessMemoryInfo(). This function is rarely used in applications and I can imagine that it is not properly supported by Wine. Can you test the same script on a real Windows system?

Re: memory() can be negative [Re: jcl] #446675
10/27/14 15:10
10/27/14 15:10
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline OP
User
GPEngine  Offline OP
User
G

Joined: Sep 2013
Posts: 504
California
This script
Code:
function run() {
  set(MUTE);
  set(PLOTNOW);
  StartDate = 20140301;
  EndDate = 20140901;
  BarPeriod = 60;

  var atrx = ATR(200);

  printf("\nMemory %i kb", memory()/1024);
}

gives the wild numbers above when run by Zorro under wine.
The same script reports consistent numbers (43MB I think) when run by Zorro within a Windows 7 VirtualBox instance.

Oddly, removing the ATR() line makes memory() result consistent under wine.

There are some discussions/bugs at winehq.org related to GetProcessMemoryInfo, which I can see now that I know what to search for. Thanks.


Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1