Mail Archives: djgpp/2001/12/06/00:47:57
Try this to see what your dpmi stats are.
This is the output from my Win2K LapTop. It show that there should be enough
memory.
Array size = 640000
largest_available_free_block_in_bytes     = 15728640
maximum_unlocked_page_allocation_in_pages = 3840
maximum_locked_page_allocation_in_pages   = 2913
linear_address_space_size_in_pages        = 524256
total_number_of_unlocked_pages            = 2920
total_number_of_free_pages                = 22902
total_number_of_physical_pages            = 49020
free_linear_address_space_in_pages        = 515387
size_of_paging_file_partition_in_pages    = 117495
#include <stdio.h>
#include <dpmi.h>
/*
typedef struct {
  unsigned long largest_available_free_block_in_bytes;
  unsigned long maximum_unlocked_page_allocation_in_pages;
  unsigned long maximum_locked_page_allocation_in_pages;
  unsigned long linear_address_space_size_in_pages;
  unsigned long total_number_of_unlocked_pages;
  unsigned long total_number_of_free_pages;
  unsigned long total_number_of_physical_pages;
  unsigned long free_linear_address_space_in_pages;
  unsigned long size_of_paging_file_partition_in_pages;
  unsigned long reserved[3];
} __dpmi_free_mem_info;
int __dpmi_get_free_memory_information(__dpmi_free_mem_info *_info);
*/
float	MyArray[10000][16];
main(void)
{
	__dpmi_free_mem_info *_info;
	printf("Array size = %lu\n",sizeof(MyArray));
	MyArray[9999][15]=4.43;
	__dpmi_get_free_memory_information( _info );
	printf("largest_available_free_block_in_bytes     = %lu\n",
_info->largest_available_free_block_in_bytes	 );
	printf("maximum_unlocked_page_allocation_in_pages = %lu\n",
_info->maximum_unlocked_page_allocation_in_pages );
	printf("maximum_locked_page_allocation_in_pages   = %lu\n",
_info->maximum_locked_page_allocation_in_pages	 );
	printf("linear_address_space_size_in_pages        = %lu\n",
_info->linear_address_space_size_in_pages		 );
	printf("total_number_of_unlocked_pages            = %lu\n",
_info->total_number_of_unlocked_pages			 );
	printf("total_number_of_free_pages                = %lu\n",
_info->total_number_of_free_pages				 );
	printf("total_number_of_physical_pages            = %lu\n",
_info->total_number_of_physical_pages			 );
	printf("free_linear_address_space_in_pages        = %lu\n",
_info->free_linear_address_space_in_pages		 );
	printf("size_of_paging_file_partition_in_pages    = %lu\n",
_info->size_of_paging_file_partition_in_pages    );
	return 0;
}
Jeff Powell
NEC CustomTechnica
-----Original Message-----
From: Tom Kent [mailto:tomkent AT iastate DOT edu]
Sent: Thursday, December 06, 2001 12:38 PM
To: djgpp AT delorie DOT com
Subject: Max array size
I was wondering if there was any maximum array size is.  I've been trying to
compile a program that has an array of floats with dimensions 10,000x16.  It
compiles fine, but then when i go to run it I get an error.  However it
compiles and runs fine under the gcc compiler on a unix machine I use.
Because of this I was hypothesizing a potential limitation either with this
compiler or with DOS.  I'm running it in cmd.exe under windows XP on a dual
1.7GHz Xeon machine with 512MB RAM.  Thanks in advance.
Tom Kent
- Raw text -