Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2003-03

Retrieving memory size?

20 messages · 9 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Preben Mikael Bohn

Dear all, I am trying to retrieve the memory size. As maxavail and memavail only gives the current available heap size (grows dynamically with the need) I can not use these functions for this purpose. Are there any ways to retrieve it in a cross-platform way?

Best regards Preben

Reply by email

A.J. Venter
to Preben Mikael Bohn

On Linux systems you can get it out of /proc. If you are on windows however, I am not sure how to do it.

Have a look at the contributed units, I am almost certain I have seen a unit there for doing it with.

Sorry if this is not wonderfull help, but then again I only develop on and for Linux.

Preben Mikael Bohn wrote 12 lines
Dear all, I am trying to retrieve the memory size. As maxavail and memavail only gives the current available heap size (grows dynamically with the need) I can not use these functions for this purpose. Are there any ways to retrieve it in a cross-platform way? Best regards Preben _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

Marco van de Voort
to Preben Mikael Bohn: Dear all, I am trying to retrieve the memory size. As maxavail and memavail only gives…
Dear all, I am trying to retrieve the memory size.

What memory size? Physical, virtual, both, physical-kernel?

As maxavail and memavail only gives the current available heap size (grows dynamically with the need) I can not use these functions for this purpose. Are there any ways to retrieve it in a cross-platform way?

There is no way yet, the only way would be to create a unit and implement them on all platforms.

- BSD (4.4 and derivates including Solaris) and Linux could use sysctl(2) to get kernel values, and probably some of these values. (FreeBSD calls it hw.physmem IIRC).

- For Dos you can get an idea by checking the CMOS and/or DPMI hosts etc, but there is no full proof way. (a lot of bioses return 64 MB for compability reasons)

For the rest (Netware,windows,OS/2,other unices or derivates if they don't support sysctl or don't allow enough values), you'd have to implement it in a platform specific way.

Reply by email

Preben Mikael Bohn
to Marco van de Voort
Marco van de Voort wrote
What memory size? Physical, virtual, both, physical-kernel?

Sorry, I meant physical.

There is no way yet, the only way would be to create a unit and implement them on all platforms.

OK. I guess I'll just have to live with this...

Best regards Preben

In politics stupidity is not a handicap - Napoleon

Reply by email

Jim Wilson
to Preben Mikael Bohn
you wrote
Sorry, I meant physical.

The Win32 API has a function called GlobalMemoryStatus that might give you some of the info you're looking for, but obviously it's not cross-platform. Don't know if that helps much.

Regards,
Jim

Reply by email

A.J. Venter
to Preben Mikael Bohn: Sorry, I meant physical. OK. I guess I'll just have to live with this... Best regards…

Hi,
How much compatibility is broken between fpc-1.0.6 and fpc-laz 1.0.7 ?

The reason I ask is that lazarus requires the latter, and I do not seem to be able to compile any of my old freepascal programs with it.

Is there some way to run Lazarus (for delphi style developement) while maintaining standard FPC abilities (for VIM style developement) ?

I would really prefer to be able to do both as the situation may require, and I would be rather dissapointed if this required my getting Kylix OE, as I am a great OSS proponent.

TIA
A.J.

"I'm a creationist. I refuse to believe that I could have evolved from man." A.J. Venter DireqLearn Linux Guru Public Key: http://www.mandrakesecure.net/en/cks/search.cgi?stype=keyid_4b&keyid_4b=F5AA10E9

Reply by email

Jonas Maebe
to A.J. Venter
A.J. Venter wrote
How much compatibility is broken between fpc-1.0.6 and fpc-laz 1.0.7 ?

Not too much hopefully, because the 1.0.x branch is the fixes branch. Normally, compatibility is only broken there if there was a bug which couldn't be (properly) fixed otherwise.

The reason I ask is that lazarus requires the latter, and I do not seem to be able to compile any of my old freepascal programs with it.

What kind of statements cause problems?

Jonas

Reply by email

Peter Vreman
to A.J. Venter: How much compatibility is broken between fpc-1.0.6 and fpc-laz 1.0.7 ? The reason I ask…
Hi, How much compatibility is broken between fpc-1.0.6 and fpc-laz 1.0.7 ?

Lazarus uses a recent 1.0.7 snapshot. The fpc-laz is just the 1.0.7 development version that will be the next 1.0.8 release

The reason I ask is that lazarus requires the latter, and I do not seem to be able to compile any of my old freepascal programs with it.

Please report the errors that you are getting to the list.

Reply by email

Mattias Gaertner
to James Mills
Show quoted text 6 lines
On Fri, Mar 28, 2003 at 02:52:31PM +0200, A.J. Venter wrote: > Hi, > How much compatibility is broken between fpc-1.0.6 and fpc-laz 1.0.7 ? Why can't Lazarus be run with just the normal FPC compiler anyway ? Why does it have to have a specially built compiler ?

As Peter said: It is no special compiler, it is the 1.0.6 with less bugs. For instance, component streaming would not work with the old 1.0.6.

Mattias

Reply by email

Marco van de Voort
to James Mills: Why can't Lazarus be run with just the normal FPC compiler anyway ? Why does it have to…
Show quoted text 6 lines
On Fri, Mar 28, 2003 at 02:52:31PM +0200, A.J. Venter wrote: > Hi, > How much compatibility is broken between fpc-1.0.6 and fpc-laz 1.0.7 ? Why can't Lazarus be run with just the normal FPC compiler anyway ? Why does it have to have a specially built compiler ?

In general, there is no reason, just that always small problems pop up when a large project as Lazarus is made.

Delphi incompabilities and recompiling problems (circular reference) that are dectected and fixed after a release have been the usual reasons for requiring snapshots.

Though the amount of problems seems to decrease with each new fixes version, and I hope that trend continues

Reply by email

James Mills
to Marco van de Voort
Marco van de Voort wrote 16 lines
> On Fri, Mar 28, 2003 at 02:52:31PM +0200, A.J. Venter wrote: > > Hi, > > How much compatibility is broken between fpc-1.0.6 and fpc-laz 1.0.7 ? > > Why can't Lazarus be run with just the normal FPC compiler anyway ? Why > does it have to have a specially built compiler ? In general, there is no reason, just that always small problems pop up when a large project as Lazarus is made. Delphi incompabilities and recompiling problems (circular reference) that are dectected and fixed after a release have been the usual reasons for requiring snapshots. Though the amount of problems seems to decrease with each new fixes version, and I hope that trend continues

In future will we see Lazurs start to work with the normal FPC compilers without the additional need to download and install the a specially built compiler for it ?

cheers
James

Show quoted text 6 lines
_______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

Mattias Gaertner
to James Mills
Show quoted text 22 lines
On Fri, Mar 28, 2003 at 02:41:17PM +0100, Marco van de Voort wrote: > > On Fri, Mar 28, 2003 at 02:52:31PM +0200, A.J. Venter wrote: > > > Hi, > > > How much compatibility is broken between fpc-1.0.6 and fpc-laz 1.0.7 > > > ? > > > > Why can't Lazarus be run with just the normal FPC compiler anyway ? > > Why does it have to have a specially built compiler ? > > In general, there is no reason, just that always small problems pop up > when a large project as Lazarus is made. > > Delphi incompabilities and recompiling problems (circular reference) > that are dectected and fixed after a release have been the usual reasons > for requiring snapshots. > > Though the amount of problems seems to decrease with each new fixes > version, and I hope that trend continues In future will we see Lazurs start to work with the normal FPC compilers without the additional need to download and install the a specially built compiler for it ?

This is always the goal.
In fact the last recommended compiler for lazarus is nearly 6 months old. As soon as the offcial 1.0.8 is there, it will become the recommended compiler. There are some remaining bugs in the current 1.0.7, which would be nice, if they could be fixed before releasing 1.0.8: typeinfo for single and double. If no one is doing that then I will send a patch for it.

Of course from time to time there will be 1.1 snapshots on the lazarus site to push the 1.1 development. But they will never be required for lazarus.

Mattias

Reply by email

Marco van de Voort
to James Mills: In future will we see Lazurs start to work with the normal FPC compilers without the…
Show quoted text 7 lines
> > Though the amount of problems seems to decrease with each new fixes version, and > I hope that trend continues In future will we see Lazurs start to work with the normal FPC compilers without the additional need to download and install the a specially built compiler for it ?

That is hard to say:

- Problems occur randomly. If we knew them now exactly, we'd fix them, so there is no way one can guarantee that stock compilers will be 100% bugfree.
But at least the fact that the rate seems to be dropping is hopeful.
- Lazarus is still developping quite fast, so that increases chances of discovering bugs.
- At some point there will be a transition from the 1.0 to the 1.1 branch.

Installing snapshots isn't that hard anyway.

Reply by email

Michael Van Canneyt
to Mattias Gaertner: On Fri, 28 Mar 2003 23:54:48 +1000 This is always the goal. In fact the last recommended…
Mattias Gaertner wrote 32 lines
On Fri, 28 Mar 2003 23:54:48 +1000 James Mills wrote: > On Fri, Mar 28, 2003 at 02:41:17PM +0100, Marco van de Voort wrote: > > > On Fri, Mar 28, 2003 at 02:52:31PM +0200, A.J. Venter wrote: > > > > Hi, > > > > How much compatibility is broken between fpc-1.0.6 and fpc-laz 1.0.7 > > > > ? > > > > > > Why can't Lazarus be run with just the normal FPC compiler anyway ? > > > Why does it have to have a specially built compiler ? > > > > In general, there is no reason, just that always small problems pop up > > when a large project as Lazarus is made. > > > > Delphi incompabilities and recompiling problems (circular reference) > > that are dectected and fixed after a release have been the usual reasons > > for requiring snapshots. > > > > Though the amount of problems seems to decrease with each new fixes > > version, and I hope that trend continues > > In future will we see Lazurs start to work with the normal FPC compilers > without the additional need to download and install the a specially > built compiler for it ? This is always the goal. In fact the last recommended compiler for lazarus is nearly 6 months old. As soon as the offcial 1.0.8 is there, it will become the recommended compiler. There are some remaining bugs in the current 1.0.7, which would be nice, if they could be fixed before releasing 1.0.8: typeinfo for single and double. If no one is doing that then I will send a patch for it.

Please do. I'll apply it.

Michael.

Reply by email

Mattias Gaertner
to Michael Van Canneyt
Show quoted text 5 lines
> There are some remaining bugs in the current 1.0.7, which would be nice, > if they could be fixed before releasing 1.0.8: typeinfo for single and > double. If no one is doing that then I will send a patch for it. Please do. I'll apply it.

Here is a patch for the rtl of fpc 1.1.

Mattias

Reply by email

Michael Van Canneyt
to Mattias Gaertner
Mattias Gaertner wrote 11 lines
On Fri, 28 Mar 2003 16:44:01 +0100 (W. Europe Standard Time) Michael Van Canneyt wrote: > > There are some remaining bugs in the current 1.0.7, which would be nice, > > if they could be fixed before releasing 1.0.8: typeinfo for single and > > double. If no one is doing that then I will send a patch for it. > > Please do. I'll apply it. And here is the patch for the 1.0.7 rtl.

Thanks. Both patches will be applied tonight.

Michael.

Reply by email

A.J. Venter
to Michael Van Canneyt: Please do. I'll apply it. Michael.

Actually my problem was with units. All my compiles failed on unit dependancies. I tried to recompile the units it was looking for, and theb copied the .ppu and .o files to /usr/lib/fpc/1.0.7/units/linux, but it still could not find them. copying them into the source directory likewize failed.

I can only imagine that either the fpc or the lazarus rpms created a congiguration filed that caused these typical locations to be ignored by the unit search routine.

I suspected thus, that the compatibility was broken between standard FPC and lazarus at the configuration level, which means it should be fixable.

While then on the topic, when I start lazarus it tells me that some functionality will be unavailable because it could not find the fpc source directory. What does this mean ? That I need to install the FPC sources in order to use lazarus ?

TIA
A.J.

Michael Van Canneyt wrote 42 lines
On Fri, 28 Mar 2003, Mattias Gaertner wrote: > On Fri, 28 Mar 2003 23:54:48 +1000 > James Mills wrote: > > > On Fri, Mar 28, 2003 at 02:41:17PM +0100, Marco van de Voort wrote: > > > > On Fri, Mar 28, 2003 at 02:52:31PM +0200, A.J. Venter wrote: > > > > > Hi, > > > > > How much compatibility is broken between fpc-1.0.6 and fpc-laz 1.0.7 > > > > > ? > > > > > > > > Why can't Lazarus be run with just the normal FPC compiler anyway ? > > > > Why does it have to have a specially built compiler ? > > > > > > In general, there is no reason, just that always small problems pop up > > > when a large project as Lazarus is made. > > > > > > Delphi incompabilities and recompiling problems (circular reference) > > > that are dectected and fixed after a release have been the usual reasons > > > for requiring snapshots. > > > > > > Though the amount of problems seems to decrease with each new fixes > > > version, and I hope that trend continues > > > > In future will we see Lazurs start to work with the normal FPC compilers > > without the additional need to download and install the a specially > > built compiler for it ? > > This is always the goal. > In fact the last recommended compiler for lazarus is nearly 6 months old. As > soon as the offcial 1.0.8 is there, it will become the recommended compiler. > There are some remaining bugs in the current 1.0.7, which would be nice, if > they could be fixed before releasing 1.0.8: typeinfo for single and double. > If no one is doing that then I will send a patch for it. Please do. I'll apply it. Michael. _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

Peter Vreman
to A.J. Venter
Show quoted text 5 lines
Actually my problem was with units. All my compiles failed on unit dependancies. I tried to recompile the units it was looking for, and theb copied the .ppu and .o files to /usr/lib/fpc/1.0.7/units/linux, but it still could not find them. copying them into the source directory likewize failed.

Compile with -vut to get information where the compiler looks for the unit files and to retrieve information why the compiler wants to recompile a unit.

Reply by email