it will depend a bit on where it runs out of memory - could you post the error message you received?
the cyclebasis method is all matlab code, so you can open it with "edit graph/cyclebasis" and read the code - this means you might be able to modify it to only return the output in pieces.
how well that will work will also depend on what you want to do with the output of cyclebasis - can you use only a subset of the returned cell array at a time, or do you need all cycles at once?