Error Code 32 / System Error 1816 追蹤

0
Avatar
Legacy Poster

Dear all,

in our environment, Commander runs as a service and processes files from a network share (Windows XP SP2, BarTender 9.3). This usually works fine for a couple of files which are recognized and then printed on a barcode printer. But in some cases, the bartend.exe (with its parameters) is called but no printer job is created. The commander.log then shows the following error:

###
[Fehler] In Commander ist beim Versuch, BarTender zu starten, ein Fehler aufgetreten.
Fehlercode: 32.
Systemfehlercode: 1816
###

("Fehler" is German and means error -> "an error has occured") ;-)

Any idea how we can fix this?

1 意見

0
Avatar
Ian Cummings
版主
評論操作 永久連結

It sounds like you need to increase the amount of desktop heap memory that is available to the Commander service. Here below is an explanation of what this is:

Desktop Heap

Synopsis
When BarTender is used in a "service context", it can be negatively impacted by a system setting known as "desktop heap". It is important to understand when this can occur, and how to correct the problem.

Desktop Heap
The "desktop heap" is a certain area of memory that is used to store information about windows, as well as objects that are used for drawing and printing. For more advanced technical information about what desktop heap is, see here: http://blogs.msdn.com/b/ntdebugging/archive/2007/01/04/desktop-heap-overview.aspx

In general, console (command line) applications do not use desktop heap memory. However, BarTender is a "Windows application", rather than a console application. When Commander controls bartend.exe processes one must understand that the BarTender application file is an integral part of the label designer, and it is impossible to print without creating several different windows, including the entire editor view. Those windows exist even when you cannot see them, and they use "desktop heap" memory.

Each instance of BarTender takes up desktop heap memory, and each format that is opened uses a bit more. (The exact numbers are difficult to measure, and vary by version, but in general as we add features in newer versions, we've been using a bit more desktop heap.)

The total amount of desktop heap memory depends on the "session" you are using. When you log in to your system, you have a visible "desktop" that belongs to your user name. That session has a block of heap memory, which is shared between applications in that session. If a different user logs in through Remote Desktop, they are using a separate desktop heap. The amount of desktop heap memory available to these sessions is known as the Interactive Desktop Heap.

Services run under a different session and have their own "desktop", even though you can't see it. Each service can have its own desktop, and therefore its own desktop heap. But there are many services on your system, so in order to limit the memory usage, Windows defaults the desktop heap size to a much lower value in this case. The amount of desktop heap memory available to these sessions is known as the Non-Interactive Desktop Heap.

Now, BarTender always uses desktop heap memory (every application that shows a user interface does). The interactive desktop heap is a number large enough to let you open thousands of windows, so we rarely see desktop heap as a problem in interactive sessions. But when running as a service, we can max out the default non-interactive desktop heap.

Symptoms
This can be difficult to diagnose. A common symptom is that when loading another format, BarTender may log an error like "Failed to create empty label format." However, this message is not guaranteed, sometimes BarTender will crash instead. It can also potentially print incorrectly, with missing fields. Depending on the credentials the service is running under, it may also be sharing a desktop heap with other services, and cause those services to malfunction in unpredictable ways.

If you are running BarTender under a service context, and you are encountering any type of reliability problem which does not occur when running BarTender either interactively or when running Commander as an application, this is a possible cause.

Solution
You can adjust the heap settings in the registry. However, the settings are embedded within a larger configuration string, and making a mistake is potentially dangerous. Therefore, we've created a tool to make this easier:

DesktopHeapControl.exe
ftp://ftp.seagullscientific.com/TechSupport/Resources/DesktopHeapControl.exe

You will need to reboot for the setting to take effect (restarting the service is not enough).

I would recommend setting it to a value of 1024 initially, perhaps increasing to 2048 or 4096 depending on the number of BarTender processes Commander controls, how many different label formats it might open, how frequent the print jobs are, and how much physical memory you actually have available.

It should be noted that in later (major) versions of BarTender/Commander we improved upon how desktop memory heap was handled thus giving a more robust installation without the need to tweak such features.

登入寫評論。