Win64 x86_64 application limited to 2GB as though it were a 32 bit app lazarus / 8-Other ---------------------------------------------------------------------- hologenicman · 2009-08-20 06:28 I am having trouble getting my app compiled for 64bit such that it will allow for more than 2GB of RAM for my application. I have project dependencies of TAChartLazarusPkg and LCL.  The TAChartLazarusPkg has a sub dependency of FCL. In the compiler settings for the Project and TAChartLazarusPkg compiler option settings I have Target OS(-T) set to Win64 and the Target CPU Family (-P) set to x86_64.  The LCL and FCL compiler options do not allow me to apply any such settings. This frustrating to me since I went over to the 64 bit platform in order to able to make use of matrix storage which is larger than the 2GB 32bit limitation. Thanks, John L> ---------------------------------------------------------------------- Vincent Snijders · 2009-08-20 08:38 What lazarus and fpc version do you use? Can you copy the version information from the about box? See also: http://bugs.freepascal.org/view.php?id=11696 You need fpc 2.3.1 or later. ---------------------------------------------------------------------- hologenicman · 2009-08-21 02:14 fpc2.2.2 came with my recent Lazarus install. I downloaded the most recent fpc2.2.4 and installed it, but I do not know how to get my lazarus to use the 2.2.4 for compiling my project. I did not find a package installer for getting the fpc2.2.4 installed to Lazarus for Windows64-bit x86_64platform. I cannot find fpc 2.3.1 or later for Windows64. John L> ---------------------------------------------------------------------- hologenicman · 2009-08-21 02:22 I found the fpc2.3.1 on the developers page: http://www.freepascal.org/develop.var I'll have a look at it, but I may have the same trouble figuring out how to get my Lazarus install to use the fpc2.3.1 John L> ---------------------------------------------------------------------- hologenicman · 2009-08-21 02:28 The current snapshot of the develo9pment versions can be found at: ftp://ftp.freepascal.org/pub/fpc/snapshot/trunk/ however, there is not a version for x86_64-Windows64.  John L> ---------------------------------------------------------------------- Troodon · 2009-08-21 04:48 daily snapshots, left hand side on the main page ---------------------------------------------------------------------- hologenicman · 2009-08-22 15:35 Thank you very much. I found the daily snapshots and downloaded/installed the 2.3.1.  I set Lazarus over to the 2.3.1 in the Environment Options, and my project is compiling sucessfuly using the fpc2.3.1. As of right now, I cannot confirm that my expanded memory needs are satisfied since my project is not running after the compile with the 2.3.1 snapshot.  I'll keep working on this and follow-up once i get my application to run. John L> ---------------------------------------------------------------------- hologenicman · 2009-08-22 19:20 When I go to build the app with expanded matrix I get the following messages: Code: [Select]Executable image size is too big for win64 target. Compilation aborted Error: C:\lazarus\fpc\2.3.1\bin\x86_64-win64\ppcx64.exe returned an error exitcode (normal if you did not specify a source file to be compiled) The expected size should be around 4.5GB running in RAM. It is actually very nice to at least get this communication from the compiler since with the fpc2.2.2 it just used to fail without giving the reason. Perhaps 2.3.1 still thinks that win64 can only handle the 2GB size. BTW, I also set the TAChartLazarus to compile with a target of Win64 and x86_64. John L> ---------------------------------------------------------------------- Vincent Snijders · 2009-08-22 19:26 As noted in the bug report, the maximum size of static arrays is 4 GB, this is a limitation of the file format. ---------------------------------------------------------------------- hologenicman · 2009-08-27 17:52 Thank you for the feedback. Obviously, this is not the end result that i had hoped for.  I did not expect to have a limitation to 4GB on the 64bit platform. Is this limitation from the PE32+ format expected to be changed in the future?  Is this file format the only option for use by Lazarus in the Win64 environment? It would seem that my options are to port over to Linux, stay within 4gb, or not use static memory. Perhaps, there is another IDE that will not use the PE32+ format on Win64 and thus will not be limited by this restriction...? Again, Thank you for the help. John L> ---------------------------------------------------------------------- Vincent Snijders · 2009-08-27 18:07 The workaround is simple, don't use static arrays, but allocate them on the heap.