On Mon, 23 Mar 2026 16:39:52 GMT, Martin Fox <[email protected]> wrote:

> I was also curious about the use of conditional compilation. And I have a few 
> other questions.
> 
> * Most of the fixes seem to be in third-party libraries. Shouldn't the fixes 
> be applied upstream of JavaFX so we don't have to maintain them locally as we 
> update the libraries?

For now we do not apply fixes to upstream for GStreamer/GLib/libFFI. It is 
something to consider. When updating libraries I never found any problems in 
maintaining fixes locally.

> * Which of these fixes are related to recovering from a memory out condition? 
> The last time this came up I did some digging around and discovered that 
> desktop operating systems almost never return NULL from malloc even when 
> memory is exhausted. Linux and macOS use an overcommit strategy which defers 
> the error to the first time you access the memory at which point the process 
> is unconditionally killed. Windows is more complicated but I recall null 
> checks aren't very effective there either; by the time you see NULL the 
> process is in a state where recovery is almost impossible.

All recently submitted NULL pointer checks are not related to memory 
allocation. They related to very unlikely conditions that might occur due to 
something did not get initialized properly or we got into bad state.

> * Is it the policy of JavaFX to check for and recover from memory out 
> conditions? Again, I'm not sure any OS will allow us to do that but in any 
> case updating the entire codebase to recover correctly would be a huge 
> undertaking and probably pointless unless we create a matching testing 
> environment.

I did some research and it looks like on Linux memory overcommit can be 
disabled and in this case malloc() will return NULL. I think it is better to 
check for NULL, since we do not know in what environment we will be executed.

> * Is there something specific to gstreamer that warrants adding checks to 
> this one subsystem?
No, nothing specific.

-------------

PR Comment: https://git.openjdk.org/jfx/pull/2115#issuecomment-4122445661

Reply via email to