IMD SolutionComputing LibraryShop main store

Troubleshooting

JVM FIFO allocation errors behind silent MQTT drops

Edge computing and IIoT Published 7 min read

Short answer

When an MQTT publisher on an Ewon Flexy gateway disconnects silently while the event log shows JVM ABORT, a tryPutFifo failure and a failed 4096-byte allocation at one timestamp, the gateway's Java runtime ran out of memory mid-publish. Correlate every disconnect with those entries, back up the unit, and test string-buffer preallocation before blaming the broker, firmware or hardware.

On this page
  1. What the log lines say
  2. Why the broker is not the suspect yet
  3. What changed on the failing unit
  4. Correlate every disconnect: worked example
  5. Diagnostic procedure
  6. The string-buffer preallocation test
  7. Decisions for each case
  8. Questions asked

An MQTT publisher that disconnects without any error while the gateway log shows a JVM ABORT with a tryPutFifo failure and a failed 4096-byte allocation is not losing its network: the gateway's Java runtime ran out of memory at the moment of the publish. The reported case is an IO-server.jar that ran for three years on an Ewon Flexy 205 with firmware 16, then on a Flexy 201 with firmware 19 it connected, pushed values, and vanished from the broker with no MQTT error at all. All three JVM entries in that log share one timestamp, which makes memory exhaustion the working cause and the broker a suspect only for the disconnects that carry no such entries. Correlate the timestamps first, back the unit up, then run the string-buffer preallocation test before touching firmware or hardware.

What the log lines say #

The event log columns — Time, Source, Event, Clock, EventID — are the gateway's standard view. The entries that matter sit under Source JVM and share one second. Trimmed to the text that carries meaning, the pair reads:

04/02/2025 22:00:55  JVM  ABORT  Wonka: tryPutFifo 655: Could not push [B@0x0070e1e8 onto fifo 0x0044e8f8!
04/02/2025 22:00:55  JVM  Failed to allocate 4096 bytes

JVM ABORT means the Java runtime abandoned an operation it could not complete. Wonka names the embedded Java VM the Flexy runs; tryPutFifo 655 is the VM routine that pushes an object onto an internal first-in, first-out queue, and 655 is the source line where that push gave up.

The object name in the fenced line is Java's way of printing a byte array: the bracket-B marks the type and the hexadecimal tail is that object's identity from one incident. The addresses change from crash to crash, so treat them as evidence that the event happened, not as a signature to search for.

Failed to allocate 4096 bytes is the reason underneath: a 4096-byte request is tiny, and when a runtime cannot find 4 KB, the memory pool it draws from is effectively full.

Why the broker is not the suspect yet #

A broker-side problem shows up as a refused connection, a keepalive timeout or a protocol-level disconnect that both ends can name. Here the client pushed values and then disappeared with no MQTT error, because the abort tears the runtime thread down before the MQTT stack can report anything: the socket closes without a protocol goodbye. A silent drop also leaves stale online status behind on the collector side — the false-positive effect described in why MQTT Engine shows online status after an edge node drops — so no alarm is not no cause.

The decision rule follows from the timestamps. Any disconnect whose second contains the allocation failure and the abort is a memory event. Any disconnect with clean JVM entries belongs to the MQTT path instead. The same failure shape — a device exhausting its own resources and dropping its communication sessions with no network cause — is documented on the PLC side in how S7-300 communication resource exhaustion drops Profibus and Ethernet connections.

What changed on the failing unit #

Three variables moved at once between the working and the failing installation: the hardware went from a Flexy 205 to a Flexy 201, the firmware from 16 to 19, and a three-year-old JAR came up against a newer runtime. That combination cannot isolate a firmware regression, a hardware defect, a configuration incompatibility or an application defect, and the old JAR is as much a suspect as either platform change. The discipline is the one used to prove an IPC slowdown is hardware, not software: change one variable per observation window and let the log counts decide.

Correlate every disconnect: worked example #

Pull the event log for the observation window and build a two-column record: every silent disconnect, and the nearest allocation-failure entry with its time delta. Use a tolerance of 5 seconds; the log clock resolves one second, and the abort and the allocation entry can land a beat apart.

Worked example, with illustrative numbers: a seven-day window shows four silent disconnects at 06:12:41, 11:47:09, 18:03:22 and 23:58:50, with allocation-failure entries at 06:12:41, 11:47:09, 18:03:23 and 23:58:54. The deltas are 0, 0, 1 and 4 seconds. All four sit inside the 5-second tolerance, so 4 ÷ 4 = 100 percent of the disconnects are memory events. Memory exhaustion is the cause; leave the broker out of it.

If instead one of six disconnects matches, 1 ÷ 6 ≈ 0.17, so about 17 percent: one drop is a memory event and five are not, and the memory fix and the network investigation both proceed, each judged on its own log set. Keep every observation window the same length — seven days before, seven days after — so firmware, configuration, memory handling and hardware stay separable.

Diagnostic procedure #

  1. Export a full backup of the Ewon before changing any code or configuration. The vendor's support team works from that backup when a hardware check is on the table, and it is your only way back if a test change goes wrong.
  2. Save the raw event log around each disconnect: the JVM entries plus the minute before them, with original timestamps, not a summary.
  3. Confirm that the configuration written through Setup - System - Storage - Edit System cfg survived the reboot, and record exactly which operation raises Board does not exists in the IO-Server list, so the original symptom travels with the workaround.
  4. Classify every disconnect with the correlation rule above: memory event or not.
  5. Review the publisher code for string building inside the publish loop, then apply the preallocation test below as the only change in the next window.
  6. Compare the allocation failures and the disconnect counts against the previous window of equal length.
  7. If the abort and the allocation failures persist with preallocation in place, send the full backup and the raw log excerpts through the vendor's official support portal and ask for the hardware check.

The string-buffer preallocation test #

A separate field report ties this same abort to a StringBuffer that could not be created or expanded while the publish loop ran. The reported change is two lines: str.ensureCapacity(10000); immediately after the declaration, and an explicit System.gc() call at the end of the function. The report describes better operation with the fix explicitly unconfirmed, so run it as a hypothesis, one change per window.

The mechanics are about removing allocation churn. Reserving room for 10000 characters up front costs 10000 × 2 bytes = 20000 bytes, about 19.5 KiB, because a char is 16 bits in this JVM generation — roughly five times the size of the failed request. The buffer then stops growing and reallocating in the middle of the loop, and on a gateway with a small fixed heap that churn is exactly the pressure that ends with a tiny request failing.

The test passes only if the abort, the allocation failures and the disconnects all stop together over an equal window. The same exhaustion has its own playbook on larger Java hosts — troubleshooting Ignition client Java heap exhaustion — and unbounded memory growth kills edge processes the same way outside Java, as in Node-RED crash and memory growth: systemd restart recovery.

Decisions for each case #

Every silent disconnect matches the allocation failure and the abort: JVM memory exhaustion on the gateway is the cause. Stop working the broker. Back the unit up, run the preallocation test, and if the abort persists, hand the full backup to the vendor's support channel for the hardware check. One safety note: this fault costs telemetry, not control, so keep any safety-relevant signaling off a JVM-based gateway path regardless of the outcome.

Disconnects with clean JVM entries: this fault is not yours. Treat them as MQTT-path problems and begin with the playbook for a PLC MQTT client that never reaches its broker.

Mixed log: fix the memory events first, because they are the ones with a test, then reclassify the remaining disconnects over a fresh window of equal length.

Resolved means more than reconnected: over an equal observation window, the configuration survives a reboot, publishing spans the old failure window without a gap, and neither the abort nor the allocation failures reappear. If support does confirm a hardware fault and the unit is not worth repairing, the same publisher role runs on a fanless industrial mini PC in the cabinet.

Questions asked

What does Failed to allocate 4096 bytes mean on an Ewon Flexy?

It records that the gateway's Java runtime could not satisfy a 4096-byte memory request at that second. A request that small fails only when the memory pool it draws from is effectively exhausted, so read it as evidence of memory exhaustion rather than a network event. Before investigating the broker, check whether each silent MQTT disconnect shares its timestamp with this entry and the tryPutFifo abort.

How do you get past Board does not exists in the IO-Server list?

The reported path is to write the configuration directly through Setup - System - Storage - Edit System cfg and reboot, then confirm the entry survives the restart. Export the full backup first, and record exactly which operation raises the error, so the original symptom travels with the workaround when you contact the vendor.

Does StringBuffer preallocation fix the tryPutFifo abort?

It is a reported improvement, not a confirmed fix. One field report ties the abort to StringBuffer objects that could not be created or expanded; reserving capacity for 10000 characters up front and calling the garbage collector at the end of the function reportedly reduced both the aborts and the disconnects. Apply it as a single controlled change and judge it by the correlation count over an equal observation window.

Can the Flexy 201 hardware or firmware 19 be ruled out?

No. The working and failing installations differ in model, firmware and the age of the JAR at the same time, so none of the three is isolated. Only a controlled comparison with one changed variable per observation window, or the vendor's analysis of a full backup, separates a firmware regression from memory handling or a hardware fault.

Why does the MQTT client drop without reporting an error?

Because the abort happens inside the Java runtime before the MQTT stack can report anything. The runtime cannot enqueue the next object, tears the operation down, and the socket closes without a protocol-level disconnect, which is why a silent drop with these entries is diagnosed from the gateway event log first and from the broker last.

Keep reading

  • Troubleshooting

    Fixing an edge gateway MQTT TLS private key load failure

    The errors error:0906D06C PEM routines:PEM_read_bio:no start line and error:140B0009 SSL routines:SSL_CTX_use_PrivateKey_file mean the gateway cannot parse its own private-key file, so the failure is local and happens before the broker sees anything. On a Flexy 205 running firmware 15.0s1 the confirmed correction is the 15.0s2 firmware upgrade with the same certificate files, not new keys or AWS IoT policy edits.

    Edge computing and IIoT

  • Troubleshooting

    Why MQTT Engine shows online status after an edge node drops

    An Info/Online tag that stays true with Good quality is not proof the edge node is alive: Engine's online state comes from the node's Sparkplug death certificate, and earlier Engine versions marked tags stale only on Engine shutdown. Read Info/Online, tag quality and Store & Forward stored metrics as three separate indicators, retest on Engine 4.0.8 with Ignition 8.0.16 or later, and compare against a node that reports correctly before escalating.

    Edge computing and IIoT

  • Troubleshooting

    Why MQTT Engine writes fail with Bad_NodeIdUnknown

    Bad_NodeIdUnknown on an MQTT Engine tag write is an OPC UA namespace lookup failure at the server executing the write — the node id is not in its address space. It is not a VPN fault: with good edge tags and a live Engine tag, fix the write target's node path, not the transport.

    Edge computing and IIoT