Bug 569053 - OOM in AutoRegisterSchemeHandlersJob
Summary: OOM in AutoRegisterSchemeHandlersJob
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.18   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-23 03:07 EST by Christian Dietrich CLA
Modified: 2020-11-23 05:49 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Dietrich CLA 2020-11-23 03:07:09 EST
java.lang.OutOfMemoryError: Java heap space
	at java.base/java.util.Arrays.copyOf(Arrays.java:3745)
	at java.base/java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:172)
	at java.base/java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:538)
	at java.base/java.lang.StringBuilder.append(StringBuilder.java:174)
	at org.eclipse.urischeme.internal.registration.ProcessExecutor.execute(ProcessExecutor.java:44)
	at org.eclipse.urischeme.internal.registration.RegistrationMacOsX.getLsRegisterOutput(RegistrationMacOsX.java:84)
	at org.eclipse.urischeme.internal.registration.RegistrationMacOsX.getSchemesInformation(RegistrationMacOsX.java:69)
	at org.eclipse.urischeme.AutoRegisterSchemeHandlersJob.run(AutoRegisterSchemeHandlersJob.java:87)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

i start eclipse with Xmx512G
Comment 1 Thomas Wolf CLA 2020-11-23 03:17:05 EST
512 Gigabytes? Really?
Comment 2 Christian Dietrich CLA 2020-11-23 03:17:28 EST
MB sry
Comment 3 Christian Dietrich CLA 2020-11-23 03:20:46 EST
builder.length()
(int) 11329077
Comment 4 Andrey Loskutov CLA 2020-11-23 03:25:57 EST
(In reply to Christian Dietrich from comment #3)
> builder.length()
> (int) 11329077

Cool. What's inside?
Comment 5 Christian Dietrich CLA 2020-11-23 03:28:22 EST
there are gazillion entries like

--------------------------------------------------------------------------------
type id:            com.apple.bundle (0x2276c)
bundle:             CoreTypes (0xc71c)
uti:                com.apple.bundle
localizedDescription: "ar" = "مجموعة", "ca" = "paquet", "cs" = "balík", "da" = "softwarepakke", "de" = "Bundle", "el" = "δέσμη", "en" = "bundle", "en_AU" = "bundle", "en_GB" = "bundle", "es" = "paquete", "es_419" = "paquete", "fi" = "nippu", "fr" = "paquet", "fr_CA" = "paquet", "he" = "חבילה", "hi" = "बंडल", "hr" = "svežanj", "hu" = "csomag", "id" = "bundel", "it" = "bundle", "ja" = "バンドル", "ko" = "번들", "LSDefaultLocalizedValue" = "bundle", "ms" = "pakej", "nl" = "bundel", "no" = "pakke", "pl" = "pakiet", "pt" = "pacote", "pt_PT" = "bundle", "ro" = "pachet", "ru" = "пакет", "sk" = "balík", "sv" = "paket", "th" = "ชุดรวม", "tr" = "paket", "uk" = "пакет", "vi" = "bó", "zh_CN" = "捆绑包", "zh_HK" = "套裝", "zh_TW" = "套件"
flags:              active  apple-internal  exported  core  trusted  is-wildcard (0000000000000275)
conforms to:        public.directory
Comment 6 Andrey Loskutov CLA 2020-11-23 05:01:44 EST
I believe you can't expect Eclipse IDE to do anything useful if started with 512 MB max heap. If you do not plan to work with the IDE, but it is just some build task that shouldn't care about AutoRegisterSchemeHandlersJob, I would recommend to run it with custom product preference org.eclipse.urischeme/skipAutoRegistration=true. No idea however hot to get the preference into your (probably maven) task.
Comment 7 Thomas Wolf CLA 2020-11-23 05:45:26 EST
(In reply to Andrey Loskutov from comment #6)
> I believe you can't expect Eclipse IDE to do anything useful if started with
> 512 MB max heap.

Possibly. However, calling that lsregister, assembling its stdout into a single string and then parsing that is a poor implementation. It should be possible to parse the InputStream line-by-line and extract the needed information. And the parsing itself in RegistrationMacOsX looks rather poor and memory-intensive, too.

Moreover, reading from that lsregister process is implemented in a very simplistic way. Maybe that acceptable since this thing runs in a job, but note that if that lsregister command for whatever reason hangs, then so does this job.
Comment 8 Christian Dietrich CLA 2020-11-23 05:49:27 EST
until now i never had problems with Xmx512M with simple hello world projects workspaces