- Temporary disabled the Encyclopedia, because it seems it takes up a huge amount of virtual/committed memory (~ 2 GB) (by tazpn)

o A define ENABLE_ENCYCLOPEDIA defines, if the encyclopedia code should be compiled
o What is happening here is encyclopedia has a lot of really big structures (ENCYCLOPEDIA_LOCATION) and then a lot of arrays of size NUM_SECTOR, NUM_PROFILES, NUMITEMS which are fairly sizable themselves.
o What the problem with doing this is when you need to allocate memory it typically needs to go to virtual memory to get large blocks of memory (malloc and related routines all do this) but you only have 2GB worth of virtual space as a pointer is 32 bits and user mode gets half of that 00000000-7FFFFFFF for addressing. This statically allocated space is taking up 7/8ths of the virtual address space. When animations or maps need to be loaded there might not be enough virtual space left due to fragmentation.
o To see the amount of committed memory, open TaskManager and add the "Committed Memory" column to the view

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5212 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2012-04-15 23:45:41 +00:00
parent 6a24e04bbc
commit b150bd172c
6 changed files with 98 additions and 38 deletions
+2 -1
View File
@@ -1016,6 +1016,7 @@ if ( ReadXMLEmail == TRUE )
}
#endif
#ifdef ENABLE_ENCYCLOPEDIA
//encyklopedia
strcpy(fileName, directoryName);
strcat(fileName, ENCYCLOPEDIALOCATIONFILENAME);
@@ -1086,7 +1087,7 @@ if ( ReadXMLEmail == TRUE )
SGP_THROW_IFFALSE(ReadInEncyclopediaLocation(fileName,TRUE,gBriefingRoomData, 4), fileName);
}
#endif
#endif //ENABLE_ENCYCLOPEDIA
UINT8 p;
for(p=0; p<NUM_PROFILES; p++)