ProjectEuler.net problem #50, Consecutive Prime Sum
Generation of prime numbers is suboptimal. Use a sieve of Erathosthenes.
isPrime is highly suboptimal. You already generated an array of all necessary primes, so just binary search it.
Breaking the loop in

        if(sumFromTo(cumulativeSums,start,end)&gt;limit)
            break;


looks like a bug. The intention is to loop by decreasing end, yet since the loop starts with the very long sequence, its sum is likely to exceed the limit right away. Shorter sequences with the same start are never tested.

Consider finding the proper end as an upper limit of a sumFromTo(cumulativeSums, start, end) &lt;= limit predicate (hint: another binary search).
You are not interested in all sequences of the primes. Most of the primes execs 2 are odd. Notice that if the sequence has an even number of odd primes, its sum is even, that is not a prime. Once the correct end is established, you may safely decrease it by 2.
Style wise, give your operators some breathing space.

    for (int end = s.size() - 1; end &gt;= start; end--) {


is much more readable than

    for (int end=s.size()-1;end&gt;=start;end--){



PS: I am not aware of any math regarding sums of consecutive primes. It is very much possible that such math exists, and the goal of this problem is to discover it. That would be a true optimization.