You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/migration-to-4x/migrating-tika-server-4x.adoc
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -576,7 +576,7 @@ xref:pipes/cpu-sizing.adoc[Forked-JVM CPU and Heap Sizing].
576
576
=== Performance Optimizations
577
577
578
578
* TCP_NODELAY enabled for reduced latency on small requests
579
-
* Configurable temp directory for RAM disk optimization (`pipes.tempDirectory`)
579
+
* Temporary files go to `-Djava.io.tmpdir`; forks get private subdirectories under it (see xref:pipes/configuration.adoc#_where_temporary_files_go[Where temporary files go]; `pipes.tempDirectory` is deprecated, and do not use a RAM disk)
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/pipes/configuration.adoc
+29-6Lines changed: 29 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,14 +57,37 @@ how many forked JVMs to run, timeouts, memory management, and parse behavior.
57
57
58
58
|`tempDirectory`
59
59
|_system default_
60
-
|Directory for temporary files. Each fork gets a subdirectory here, and the fork's whole `java.io.tmpdir` points at it, so anything the fork spools while parsing, unpacked embedded files and JVM crash logs all land inside. It does *not* cover the host side: tika-server spools over-threshold request bodies into its own input temp directory, and `PipesForkParser` into the calling JVM's `java.io.tmpdir`. Consider a RAM-backed filesystem (e.g., `/dev/shm`) for better performance -- but see the caveat below.
60
+
|*Deprecated since 4.1, removal planned for 5.0.* Set `-Djava.io.tmpdir` on the parent JVM instead; see below. Still honored: each fork gets a subdirectory here, and the fork's whole `java.io.tmpdir` points at it. It never covered the host side -- tika-server's request-body spool and `PipesForkParser` use the parent's `java.io.tmpdir` -- nor any library that calls `File.createTempFile` itself.
61
61
|===
62
62
63
-
The parent deletes a fork's subdirectory when that fork is torn down or fails to start, so a
64
-
crashing fork does not accumulate them. A parent killed abruptly (`SIGKILL`, container stop)
65
-
cannot, and its subdirectories survive. On a RAM-backed filesystem those leaks consume memory
66
-
rather than disk, and `/dev/shm` is commonly sized at half of RAM -- so if you point
67
-
`tempDirectory` at one, sweep it on service start.
63
+
=== Where temporary files go
64
+
65
+
Set `-Djava.io.tmpdir` on the parent JVM. It has to be a launch flag because of Tika's
66
+
dependencies: POI, PDFBox and the rest create temp files through the JDK, which reads
67
+
`java.io.tmpdir` once at JVM start, so nothing Tika sets at runtime reaches them.
68
+
Tika, every library it calls, and its forked pipes servers all honor the flag: each fork gets a private subdirectory under it (its whole
69
+
`java.io.tmpdir` points there, so spooled input, unpacked embedded files and JVM crash logs
70
+
all land inside), and the parent deletes that subdirectory when the fork is torn down.
71
+
Tika checks the directory exists and is writable at config load and refuses to start
72
+
otherwise, rather than failing on the first document that spools.
73
+
74
+
If the parent dies, a surviving fork deletes its own subdirectory as it exits. Only when the
75
+
whole process family is killed at once (`SIGKILL` of the group, container stop) do
76
+
subdirectories survive, with whatever the forks were spooling inside; Tika never deletes
77
+
directories another process created. Point `java.io.tmpdir` at a disk-backed directory on a
78
+
volume where filling it does not take out the OS, and apply your own retention to
79
+
`pipes-server-*` there.
80
+
81
+
[WARNING]
82
+
====
83
+
*DO NOT USE tmpfs* (`/dev/shm`, any RAM-backed filesystem) for `java.io.tmpdir`.
84
+
85
+
Spool size is bounded by the input, not by any Tika setting: one large archive expanding
86
+
into tmpfs can exhaust memory for every process on the host or get a container evicted,
87
+
and a fork directory orphaned by a killed parent pins that RAM until someone deletes it.
88
+
A slow run is recoverable; a lost host is not. If you must, give tmpfs a dedicated mount
89
+
with `size=` so the failure is a refused write rather than a lost host.
Copy file name to clipboardExpand all lines: tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-microsoft-module/src/main/java/org/apache/tika/parser/microsoft/rtf/jflex/RTFEmbeddedHandler.java
Copy file name to clipboardExpand all lines: tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-microsoft-module/src/main/java/org/apache/tika/parser/microsoft/rtf/jflex/RTFHtmlDecapsulator.java
0 commit comments