- 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
+5 -21
View File
@@ -185,17 +185,6 @@ typedef struct
#define MISSIONSTART 1
#define MISSIONEND 2
extern ENCYCLOPEDIA_LOCATION gEncyclopediaLocationData[ NUM_SECTOR ];
extern ENCYCLOPEDIA_LOCATION gEncyclopediaProfilesData[ NUM_PROFILES ];
extern ENCYCLOPEDIA_LOCATION gEncyclopediaDataTemp[ NUM_MAX_TEMP ];
extern ENCYCLOPEDIA_LOCATION gEncyclopediaInventoryData[ MAXITEMS ];
extern ENCYCLOPEDIA_LOCATION gEncyclopediaOldProfilesData[ NUM_PROFILES ];
extern ENCYCLOPEDIA_LOCATION gEncyclopediaQuestsData[ MAX_QUESTS ];
extern ENCYCLOPEDIA_LOCATION gBriefingRoomData[ NUM_SECTOR ];
extern ENCYCLOPEDIA_LOCATION gBriefingRoomSpecialMissionData[ NUM_SECTOR ];
typedef struct
{
UINT32 uiIndex;
@@ -210,16 +199,11 @@ typedef struct
INT32 CheckMission;
} MISSION_SAVE;
//extern MISSION_SAVE saveMissionData[ NUM_SECTOR ];
extern BOOLEAN saveEncyclopediaLocationData[ NUM_SECTOR ];
extern ENCYCLOPEDIA_PROF_SAVE saveEncyclopediaProfilesData[ NUM_PROFILES ];
extern BOOLEAN saveEncyclopediaInventoryData[ MAXITEMS ];
extern BOOLEAN saveEncyclopediaOldProfilesData[ NUM_PROFILES ];
extern BOOLEAN saveEncyclopediaQuestsData[ MAX_QUESTS ];
extern MISSION_SAVE saveBriefingRoomData[ NUM_SECTOR ];
extern MISSION_SAVE saveBriefingRoomSpecialMissionData[ NUM_SECTOR ];
extern void InitEncyklopediaBool();
extern void ShowNPCEncyclopediaEntry(UINT8 ubNPC, BOOLEAN hidden);
extern ENCYCLOPEDIA_LOCATION gEncyclopediaProfilesData[];
extern ENCYCLOPEDIA_LOCATION gBriefingRoomData[];
#endif