1

My program uses all of available memory, so I wanted to check which functions and abstracts are spoiling my project. I decided to use Memprof, so I installed their compiler and compiled my code with command

ocamlfind ocamlopt -package xml-light unix.cmxa str.cmxa -c -g  NKJPxmlbasics.ml NKJP.mli NKJP.ml test.ml

and then run as suggested in tutorial

ocp-memprof --exec ./test

But there is error instead of result:

Error: no memory profiling information found. Possible causes: - the application was not compiled with memory profiling support; - the application exited before any major garbage collection was performed.

I even managed once to make it work but I have no idea how it happened http://memprof.typerex.org/users/97beffbaec332eb7b2a048b94f7a38cf/2015-12-15_17-33-50_ab17218e800fe0a68fc2cfa54c13bfa6_16194/index.html

Is there any way to use this tool properly in this situation? What am I missing?

2
  • What does which ocamlopt return ? Are you sure your executable's name is test ? Your application was running for a (long) moment before crashing with "Out of memory" ? Commented Dec 27, 2015 at 19:10
  • My app didn't crash but was taking about 3 GB before I managed to finally profile memory. I found that in one recursive function I misspelled variable and it caused memory leak. Commented Jan 3, 2016 at 12:42

1 Answer 1

1

ocamlfind ... -c ... does not generate any executable. So, the ./test that you are running was probably generated by a previous command, probably without the memprof switch.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.