Home › Forums › Knowledge Base › Legacy Applications › Memory Optimization Tricks
- This topic has 0 replies, 1 voice, and was last updated 19 years ago by
Rob.
-
AuthorPosts
-
April 15, 2006 at 2:49 pm #1669
Rob
MemberMemory Optimization Tricks
Wouldn’t you just love it if you could throw whatever software you want on your system and not worry about dealing with memory? Well, I’ve got some good news and some bad news. The good news is that Windows95/98/NT takes care of all that. The bad news is that Windows is overkill for a workstation running TouchPro, so you’re just going to have to take the time to give DOS a little help in setting up it’s memory.
For those of you who actually understand all the technical details of memory management, let me say that I am intentionally simplifying some aspects of it, so don’t send me any E-mails saying that I didn’t get something exactly correct. Just remember that I never make a misteak.
How Memory is StructuredLet’s start with the basics. No matter how many googlebytes of memory your computer has, DOS breaks it into three areas. The first 640KB of memory is referred to as base memory and this is the primary work area for DOS. The next 360KB of memory is a special storage area used by DOS for internal caching and other techy type things. It is usually referred to as upper memory. Since DOS was only designed to access 1MB of memory (640KB + 360KB = 1MB), any memory above that is referred to as high memory. Without help, the only area that a DOS program can actually use is base memory.
Where Stuff GoesNow lets take a look some of our Config.Sys and Autoexec.Bat commands and see how they affect the system.
Config.Sys Commands
DEVICE=HIMEM.SYS – Since DOS can only access 1MB of memory directly, this driver gives it a method of using the high memory beyond that. Using HIMEM.SYS, this area is then referred to as extended or XMS memory.
DEVICE=EMM386.EXE NOEMS I=aaaa-bbbb X=aaaa-bbbb – This driver can provide several different memory usage services. We use it because it tells DOS how to use upper memory. It also provides for another way to access high memory called expanded or EMS memory. However, this reduces the amount of upper memory available, so we use the NOEMS switch to tell EMM386 not to provide expanded memory. Since the BIOS and some add-on cards also use upper memory, it is sometimes necessary to tell EMM386 which areas to use and/or which areas to stay away from. The I= switch tells EMM386 to include aaaa to bbbb in the available memory area. X= explicitly tells EMM386 to exclude that area.
DEVICE=RAMDRIVE.SYS 300 /E – Now that extended memory is available, this command sets aside 300K of it to emulate a disk drive. TouchPro uses it as a temporary work area. As a side note this is one of the few places where E is the abbreviation for extended memory, not another type referred to as expanded memory.
DOS=HIGH,UMB – This is two commands in one. HIGH tells DOS to load itself into extended(high) memory leaving more of that precious base memory available. UMB tells DOS it is okay to give control of upper memory to a memory manager that knows what to do with it, and darned if we didn’t just load EMM386 a couple of commands ago.
LASTDRIVE=Z – This tells DOS to make all letters available to be used as drive letters. This command is required for the MOVERAMD command that follows.
Autoexec.Bat Commands
MOVERAMD Z: – Touchnet requires that drive Z be a valid drive and this Touch Menus utility tells DOS to assign the ramdrive as that drive. The DOS SUBST command can be used instead but it requires that you know what drive letter DOS originally assigned to the RamDrive.Sys driver.
LANCACHE TYPE=XMS – This is only needed if Lantastic is running as a server and tells Lantastic to set aside some extended memory to be used to cache the disk drive. Lantastic will use all available XMS memory up to 2.1MB.
The MEM CommandHow do you tell how your memory is configured? Type MEM/C/P at a DOS prompt and you will get a screen full of memory information. In particular, pay attention to the column labeled Conventional and the row labeled Free. This is your available base memory. The right column shows your available upper memory.
The second section of the MEM command gives a memory summary and will tell you how your high memory is allocated among other things. The most important factor is to know how much extended memory you still have free. This will become important in the section on Configuring Lantastic Print Servers.
Maximizing Base MemoryAs each driver loads up on bootup it takes up a portion of memory. Without any specific instructions to tell it otherwise, DOS puts these drivers in base memory, decreasing the amount of memory available for Touchnet. As this tech tip is being written, the current version of Touchnet is 6.54 and requires about 540KB of base memory. Since most systems have more than 100KB of drivers, that original 640KB of base memory often dwindles to an available amount too small for Touchnet to run properly and it starts crashing with an error 7.
The answer is to put those drivers in upper memory. How do you do that? Well, most of the components are already in place. EMM386 can manage upper memory, and DOS has been told to give EMM386 access to it. The last component is to tell DOS which drivers to actually put into upper memory. In the Config.Sys this is done by changing the DEVICE= command to DEVICEHIGH= instead. In the Autoexec.Bat you add a LOADHIGH or LH command to the front of the regular command (e.g. MTMOUSE becomes LH MTMOUSE). Don’t let the LOADHIGH command fool you. It loads into upper memory, not high memory.
Some drivers do not always run as efficiently when loaded into upper memory. However this performance loss is usually negligible and the newer PCs have speed to spare, so don’t worry about those warning messages you read in the manuals.
There is only a limited amount of upper memory available and DOS doesn’t do any rearranging to come up with the optimum fit. Although there is a utility called MEMMAKER to do this, I don’t recommend you use it, for reasons I’m not going to discuss here. Instead, play around with your LH commands; adding them to one command and removing them from another until the MEM command tells you that enough base memory is available.
Running Touchnet on Print ServersNormally a few LH commands will take care of you, but in the case where you are running a workstation a Lantastic print server, more work is usually needed. The first problem is that the default installation of Lantastic has the Server module taking up over 60KB of memory. This sometimes leaves you with insufficient base memory even after all of upper memory is filled up. Most of this 60KB is really needed, but there is a chunk of 12KB to 15KB that is used for managing file sharing and this feature is not needed on a print server. To change it, perform the following steps.
1. First make sure your current drive is the C drive.
2. Run NET_MGR.
3. Scroll down to Internal Share: Select to Manage and press Enter.
4. Press Enter again to Disable Internal Share Support.
5. Press Escape as needed to exit NET_MGR.The second problem associated with print servers occurs when you have 4MB of memory or less installed. When Touchnet shells to another program, it needs about 500K of extended memory free so that it can swap itself out of base memory. If Touchnet doesn’t have enough extended memory, it swaps itself over the network as a temporary file on the server. This can add several seconds to the time it takes a shell to execute. When running as a print server on a 4MB system, it is necessary to reduce the amount of extended memory that Lancache grabs. This is done by adding the command line switch /CACHE_SIZE=1600.
Running Touchnet on File Servers
Don’t!
-
AuthorPosts
- You must be logged in to reply to this topic.