Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: mod_backhand: devel

available memory for FreeBSD

 

 

mod_backhand devel RSS feed   Index | Next | Previous | View Threaded


hopet at ics

Jan 6, 2004, 9:03 AM

Post #1 of 2 (6556 views)
Permalink
available memory for FreeBSD

Hi all,

I would suggest a small correction for computing available memory
on FreeBSD:

--- platform.c.old Sat Aug 24 22:16:03 2002
+++ platform.c Tue Jan 6 17:00:31 2004
@@ -589,8 +589,7 @@
#endif
len = sizeof(struct vmtotal);
sysctl(mib, 2, &ourmem, &len, NULL, 0);
- ourmem.t_free /= 1024*1024; /* calculate in mb */
- ss->amem=(int)usermem-(ourpagesize*ourmem.t_free);
+ ss->amem=(int)ourpagesize*ourmem.t_free/(1024*1024);
ss->cpu =(int)ourcpu;
ss->ncpu=(int)ncpu;
/* Fill out hostname */


Could somebody verify that it's OK?

Thanks,
Petr


jesus at omniti

Feb 23, 2004, 1:20 PM

Post #2 of 2 (6021 views)
Permalink
available memory for FreeBSD [In reply to]

Message got lost for a while... Looks good. comitted.

On Tue, 2004-01-06 at 11:03, Petr Holub wrote:
> Hi all,
>
> I would suggest a small correction for computing available memory
> on FreeBSD:
>
> --- platform.c.old Sat Aug 24 22:16:03 2002
> +++ platform.c Tue Jan 6 17:00:31 2004
> @@ -589,8 +589,7 @@
> #endif
> len = sizeof(struct vmtotal);
> sysctl(mib, 2, &ourmem, &len, NULL, 0);
> - ourmem.t_free /= 1024*1024; /* calculate in mb */
> - ss->amem=(int)usermem-(ourpagesize*ourmem.t_free);
> + ss->amem=(int)ourpagesize*ourmem.t_free/(1024*1024);
> ss->cpu =(int)ourcpu;
> ss->ncpu=(int)ncpu;
> /* Fill out hostname */
>
>
> Could somebody verify that it's OK?
>
> Thanks,
> Petr
>
> _______________________________________________
> backhand-devel mailing list
> backhand-devel [at] lists
> http://lists.backhand.org/mailman/listinfo/backhand-devel
--
// Theo Schlossnagle
// Principal Engineer -- http://www.omniti.com/~jesus/
// Postal Engine -- http://www.postalengine.com/
// Ecelerity: fastest MTA on earth

mod_backhand devel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.