GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - BruceWind/OperatingImageBypassJavaHeap: Bypassing java heap to operate images,will 100% avoid OOM (Maintenance stopped)绕过java heap操作图片,100%避开OOM

This repository was archived by the owner on Jul 4, 2023. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

27 Commits
27 Commits

Folders and files

NameName
Last commit message
Last commit date
app
app
 
 
gradle/wrapper
gradle/wrapper
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
LICENSE_CN
LICENSE_CN
 
 
README.md
README.md
 
 
README_CN.md
README_CN.md
 
 
build.gradle
build.gradle
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

OperatingImageBypassJavaHeap

中文

Announcement regarding discontinued maintenance in 2021:

In devices above Android 8.0, bitmaps store in native heaps. In the future, most devices will keep upgrading to new above 8.0, so this repo will be useless. This is why I have decided to stop maintaining it. I apologize to anyone who looks forward to updates.


The size of physical memory RAM has been increasing for a decade; the limitation of the Java heap exists, though. Furthermore, the camera is improved, and the size of the images that we need to operate keeps increasing. By the way, even though some brands or companies produce phones whose xmx has been modified, the limitations on those devices are still insufficient for immensely large images.

It is a fact that Android's JVMs such as Dalvik and ART accord with JVM standards. So that the Android JVM has a configuration with xmx.

In the README, I don't explain more about what xmx is. You can look into docs or websites for more about it.

Due to the limitation of Java heap for one application, while you operate large bitmaps, the device may throw OOM.

On the other hand, the native heap has no limitation. It is able to allocate reach physical size. So, operating images in the native heap can avoid OOM. In this repo, I bypass Bitmap. In case it bypasses bitmap, it will bypass the Java heap.

To sum up, the native heap is unlimited for every developer. This is why the repo works. All operations of images are in the native heap, which will completely avoid OOM.

The evidence for that the native heap doesn't have limitations.

click to expand

I have tried to allocate numerous memory in the native heap and don't execute free. The allocated memory exceeds 1G, which didn't give rise to OOM.

Below a picture, I run adb shell dumpsys meminfo PACKAGENAME to print that memory information.

The repo progress

  • rotate jpeg

  • compress jpeg

  • resize jpeg

  • compress png (2018.04.10)

    • provide other algorithms about compression, may introduce optipng, which has been used in most services or applications.
  • rotate png

  • resize png

Build tips

  1. before you run on the device, you need to put a test.jpg on external storage.

  2. After you start this app:

    test.jpg ----------compress/rotate---------> test2.jpg

Thanks

base on::bither-android-lib

github:libjpeg-turbo

source.android.com/...../dalvik_vm_properties

sourceforge:libjpeg

About

Bypassing java heap to operate images,will 100% avoid OOM (Maintenance stopped)绕过java heap操作图片,100%避开OOM

Topics

androidbitmapdalvik-heaplibjpegmemoryoom

Resources

Readme
License
Activity

Stars

41 stars

Watchers

1 watching

Forks

2 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.