Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

react-native : can't push to git because of hprof file

Tags:

I would like to push my project into the github, however i just notice there is a file called java_pid14920.hprof inside the android folder and cause around 300MB

remote: error: File android/java_pid14920.hprof is 301.75 MB; this exceeds GitHub's file size limit of 100.00 MB

I wonder it is safe to delete this file ?

like image 312
FeelRightz Avatar asked Oct 31 '19 15:10

FeelRightz


People also ask

Can I delete Java_pid Hprof file?

HPROF is a binary heap dump format originally supported by J2SE. You can delete it.

What is a Hprof file?

hprof files are heap dump of the memory of java-based processes. Huge hprof files most commonly indicate out of memory issues about the related processes. These hprof files can be configured at startup to track and monitor memory performance issues.

Why Hprof files are created?

An Hprof file can be created as a heap dump of the memory of a Java™ process. This is typically created when there is an Out of Memory error occurs on the system.

What is Hprof file in Android?

A heap dump is a snapshot of an application's heap, which is stored in a binary format called HPROF. Dalvik uses a format that is similar, but not identical, to the HPROF tool in Java. There are a few ways to generate a heap dump of a running Android app. One way is to use the Dump HPROF file button in DDMS.


1 Answers

The only answer here didn't work for me, but I found a solution that did.

My offending file was android/java_pid2325.hprof, but yours obviously may vary. I used git filter-branch:

git filter-branch -f --index-filter 'git rm --cached --ignore-unmatch android/java_pid2325.hprof'

Make sure to add *.hprof to your .gitignore and push the commit.

Note*-> Make sure to change the name of *.hprof to the same as your local *.hprof

like image 140
David Biggs Avatar answered Sep 28 '22 03:09

David Biggs