11

GWT 2.5.1

Anytime running GWT DevMode generates a new huge cache file under /tmp directory now, consequently the OS warns low disk space. However, this problem has never popped up in the past.

The file gwtXXXbyte-cache (XXX being a long random number) is nearly 1 GB big. Is it normal?

The cache file is cleaned up automatically after the DevMode session ends. BTW, rebooting the machine doesn't help.

@EDIT

In comparison above, running GWT starter application on DevMode generates the new cache file about 50 MB size. Is it oversize, too?

@EDIT 2

I modifed GWT UI releated source code and ran DevMode again. Later, the new huge cache file gwtYYYbyte-cache (YYY being another long random number) was generated with the same size as before - exact number of bytes. Any ideas?

@EDIT 3

After manual removal of ./gwt-unitCache, ./war/WEB-INF/deploy and ./war/ZZZ directory (ZZZ being the hosted GWT application on DevMode), the next DevMode session generates the /tmp/gwtXXXbyte-cache file shrinking to a few KB.

@EDIT 4

Launching DevMode with the option -workDir DDD (DDD being another writable directory) doesn't work. The cached staffs keep writing to the default /tmp directory.

Cœur
  • 37,241
  • 25
  • 195
  • 267
sof
  • 9,113
  • 16
  • 57
  • 83
  • 1
    I'm using GWT 2.5.0 and I'm getting a unitcache file of 55.9MB for the GWT starter App. – Vjeetje Aug 25 '13 at 11:25
  • 1
    From http://stackoverflow.com/questions/8973511/what-is-the-gwt-byte-cache-file: "Looking at the gwt source code, it says it's "A global shared Disk cache", used by a linker (com.google.gwt.core.ext.linker package) and compiler (com.google.gwt.dev.javac package)." – Vjeetje Aug 25 '13 at 11:26
  • I see this all the time on a Windows 7 dev machine using Eclipse. Periodically, I just flush everything in C:\Users\myname\AppData\Local\Temp -- it can be 10s of GB. – fred02138 Aug 29 '13 at 13:28

2 Answers2

4

1GB is too much for development purposes. The only reason I can think of is that you have set a lot of permutations in your .gwt.xml file. You should reduce the number of permutations during development to the minimum ( only include the specs you are using). You can use the DevGuideCompileReport to locate the problem.

Edit:

The common issue has been reported by other users. It has to do with the eclipse plugin not deleting the temp files correctly. The issue has been reported and had a lot of attention from GWT users, but no concrete patch has been released. The workarounds were to manually delete the files or to write a script to do the work for you:

google-plugin-for-eclipse-issue74

Vjeetje
  • 5,314
  • 5
  • 35
  • 57
  • No, it's on the process of `DevMode`, permutations of statically compiling java source to javascript are not yet involved. – sof Aug 25 '13 at 09:28
  • The problem of mine isn't same, i.e. every new `DevMode` session generates the huge cache file alone, which isn't accumulated by one after another. The end of every `DevMode` session cleans up the cache file `automatically`. – sof Aug 25 '13 at 09:43
  • I'm having same problem, but I'm using Gradle and IntelliJ, so this can't possibly be as simple as a problem with an eclipse plugin. – Hank Schultz Nov 09 '16 at 14:25
2

Here's a windows batch script to clean up after GWT:

@ECHO OFF

ECHO Cleaning ImageResourceGenerator files ...
IF EXIST "%TEMP%\ImageResourceGenerator*" DEL "%TEMP%\ImageResourceGenerator*" /F /Q

ECHO Cleaning uiBinder files ...
IF EXIST "%TEMP%\uiBinder*" DEL "%TEMP%\uiBinder*" /F /Q

ECHO Cleaning gwt files ...
IF EXIST "%TEMP%\gwt*" DEL "%TEMP%\gwt*" /F /Q

ECHO Cleaning gwt directories ...
FOR /D /R %TEMP% %%x IN (gwt*) DO RMDIR /S /Q "%%x"

ECHO.
ECHO Done.
PAUSE
Craigo
  • 3,384
  • 30
  • 22